yaya-sy commited on
Commit
8458d22
1 Parent(s): a320278

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)