Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 28 |
-
speech = speech
|
| 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):
|