Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,11 @@ def transcribe(file):
|
|
15 |
|
16 |
#print("filename: ",file)
|
17 |
try:
|
18 |
-
audio = AudioSegment.from_file(file)
|
|
|
|
|
|
|
|
|
19 |
new_file_name = file.split(".")[0]+".wav"
|
20 |
audio.export(new_file_name,format)
|
21 |
except Exception as e:
|
|
|
15 |
|
16 |
#print("filename: ",file)
|
17 |
try:
|
18 |
+
audio = AudioSegment.from_file(file)
|
19 |
+
if audio.frame_rate != 16000:
|
20 |
+
audio = audio.set_frame_rate(16000)
|
21 |
+
if audio.channels != 1:
|
22 |
+
audio = audio.set_channels(1)
|
23 |
new_file_name = file.split(".")[0]+".wav"
|
24 |
audio.export(new_file_name,format)
|
25 |
except Exception as e:
|