Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ def transcribe(audio_file_mic=None, audio_file_upload=None):
|
|
| 34 |
speech, sample_rate = librosa.load(audio_file)
|
| 35 |
if sample_rate != 16000:
|
| 36 |
speech = librosa.resample(speech, orig_sr=sample_rate, target_sr=16000)
|
| 37 |
-
duration = librosa.get_duration(speech)
|
| 38 |
if duration > 30:
|
| 39 |
speech = speech[:max_duration]
|
| 40 |
return transcribe_audio(speech)
|
|
|
|
| 34 |
speech, sample_rate = librosa.load(audio_file)
|
| 35 |
if sample_rate != 16000:
|
| 36 |
speech = librosa.resample(speech, orig_sr=sample_rate, target_sr=16000)
|
| 37 |
+
duration = librosa.get_duration(y=speech, sr=16000)
|
| 38 |
if duration > 30:
|
| 39 |
speech = speech[:max_duration]
|
| 40 |
return transcribe_audio(speech)
|