moro23 commited on
Commit
9fe9205
·
verified ·
1 Parent(s): d0e5551

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -24,11 +24,11 @@ def load_data(input_file):
24
 
25
  speech , sample_rate = librosa.load(input_file)
26
  #make it 1-D
27
- if len(speech.shape) > 1:
28
- speech = speech[:,0] + speech[:,1]
29
  #Resampling the audio at 16KHz
30
  if sample_rate !=16000:
31
- speech = librosa.resample(speech, sample_rate, 16000)
32
  return speech
33
 
34
  def correct_casing(input_sentence):
 
24
 
25
  speech , sample_rate = librosa.load(input_file)
26
  #make it 1-D
27
+ if speech.ndim > 1:
28
+ speech = speech.mean(axis=1)
29
  #Resampling the audio at 16KHz
30
  if sample_rate !=16000:
31
+ speech = librosa.resample(speech, orig_sr=sample_rate, target_sr=16000)
32
  return speech
33
 
34
  def correct_casing(input_sentence):