vineelpratap
commited on
Commit
•
9fea840
1
Parent(s):
d8e33ba
Update asr.py
Browse files
asr.py
CHANGED
@@ -72,10 +72,10 @@ def transcribe(audio_data, lang="eng (English)"):
|
|
72 |
# microphone
|
73 |
sr, audio_samples = audio_data
|
74 |
audio_samples = (audio_samples / 32768.0).astype(np.float32)
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
else:
|
80 |
# file upload
|
81 |
isinstance(audio_data, str)
|
|
|
72 |
# microphone
|
73 |
sr, audio_samples = audio_data
|
74 |
audio_samples = (audio_samples / 32768.0).astype(np.float32)
|
75 |
+
if sr != ASR_SAMPLING_RATE:
|
76 |
+
audio_samples = librosa.resample(
|
77 |
+
audio_samples, orig_sr=sr, target_sr=ASR_SAMPLING_RATE
|
78 |
+
)
|
79 |
else:
|
80 |
# file upload
|
81 |
isinstance(audio_data, str)
|