Update app.py
Browse files
app.py
CHANGED
|
@@ -23,13 +23,13 @@ def transcribe(audio):
|
|
| 23 |
y = y.mean(axis=1)
|
| 24 |
|
| 25 |
# resample to 16kHz if needed
|
| 26 |
-
if sr != 16000:
|
| 27 |
-
|
| 28 |
|
| 29 |
y = y.astype(np.float32)
|
| 30 |
y /= np.max(np.abs(y))
|
| 31 |
|
| 32 |
-
return transcriber({"sampling_rate":
|
| 33 |
|
| 34 |
examples = []
|
| 35 |
examples_dir = "examples"
|
|
|
|
| 23 |
y = y.mean(axis=1)
|
| 24 |
|
| 25 |
# resample to 16kHz if needed
|
| 26 |
+
#if sr != 16000:
|
| 27 |
+
# y = librosa.resample(y, orig_sr=sr, target_sr=16000)
|
| 28 |
|
| 29 |
y = y.astype(np.float32)
|
| 30 |
y /= np.max(np.abs(y))
|
| 31 |
|
| 32 |
+
return transcriber({"sampling_rate": sr, "raw": y})["text"]
|
| 33 |
|
| 34 |
examples = []
|
| 35 |
examples_dir = "examples"
|