Update app.py
Browse files
app.py
CHANGED
@@ -18,8 +18,8 @@ def transcribe(audio):
|
|
18 |
# convert to mono if stereo
|
19 |
if y.ndim > 1:
|
20 |
y = y.mean(axis=1)
|
21 |
-
|
22 |
-
|
23 |
return transcriber({"sampling_rate": sr, "raw": y})["text"]
|
24 |
|
25 |
|
|
|
18 |
# convert to mono if stereo
|
19 |
if y.ndim > 1:
|
20 |
y = y.mean(axis=1)
|
21 |
+
y = y.astype(np.float32)
|
22 |
+
y /= np.max(np.abs(y))
|
23 |
return transcriber({"sampling_rate": sr, "raw": y})["text"]
|
24 |
|
25 |
|