nareauow commited on
Commit
8c217ec
·
verified ·
1 Parent(s): a3c53b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -12
app.py CHANGED
@@ -129,18 +129,7 @@ def recognize_speech(audio_path):
129
 
130
  try:
131
  audio_data, sr = sf.read(audio_path)
132
-
133
- if len(audio_data.shape) > 1:
134
- audio_data = np.mean(audio, axis=1)
135
-
136
- if sr != 16000:
137
- audio_data = np.interp(
138
- np.linspace(0, len(audio_data), int(16000 * len(audio_data) / sr)),
139
- np.arange(len(audio_data)),
140
- audio_data
141
- )
142
- sr = 16000
143
-
144
  inputs = speech_processor(
145
  audio_data,
146
  sampling_rate=sr,
 
129
 
130
  try:
131
  audio_data, sr = sf.read(audio_path)
132
+
 
 
 
 
 
 
 
 
 
 
 
133
  inputs = speech_processor(
134
  audio_data,
135
  sampling_rate=sr,