Spaces:
Build error
Build error
Commit
·
4f05fae
1
Parent(s):
d2ef284
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,9 @@ def stt_record(audio_record_buffer):
|
|
44 |
else:
|
45 |
sr, y = audio_record_buffer
|
46 |
|
47 |
-
y = librosa.resample(y, orig_sr=sr, target_sr=16000)
|
|
|
|
|
48 |
|
49 |
scorer = True # use scorer
|
50 |
if scorer:
|
|
|
44 |
else:
|
45 |
sr, y = audio_record_buffer
|
46 |
|
47 |
+
y = librosa.resample(y, orig_sr=sr, target_sr=16000)
|
48 |
+
#normalize to int16
|
49 |
+
y = ( np.iinfo("int16").max *(y - np.min(y))/np.ptp(y)).astype("int16")
|
50 |
|
51 |
scorer = True # use scorer
|
52 |
if scorer:
|