csukuangfj
commited on
Commit
·
129bf83
1
Parent(s):
ef3927c
small fixes
Browse files
app.py
CHANGED
@@ -40,10 +40,13 @@ def convert_to_wav(in_filename: str) -> str:
|
|
40 |
out_filename = in_filename + ".wav"
|
41 |
logging.info(f"Converting '{in_filename}' to '{out_filename}'")
|
42 |
_ = os.system(f"ffmpeg -hide_banner -i '{in_filename}' -ar 16000 '{out_filename}'")
|
43 |
-
|
|
|
|
|
44 |
s = "\n" + out_filename + "\n"
|
45 |
s += base64.b64encode(f.read()).decode()
|
46 |
logging.info(s)
|
|
|
47 |
return out_filename
|
48 |
|
49 |
|
|
|
40 |
out_filename = in_filename + ".wav"
|
41 |
logging.info(f"Converting '{in_filename}' to '{out_filename}'")
|
42 |
_ = os.system(f"ffmpeg -hide_banner -i '{in_filename}' -ar 16000 '{out_filename}'")
|
43 |
+
_ = os.system(f"ffmpeg -hide_banner -loglevel error -i '{in_filename}' -ar 16000 '{out_filename}.flac'")
|
44 |
+
|
45 |
+
with open(out_filename+".flac", "rb") as f:
|
46 |
s = "\n" + out_filename + "\n"
|
47 |
s += base64.b64encode(f.read()).decode()
|
48 |
logging.info(s)
|
49 |
+
|
50 |
return out_filename
|
51 |
|
52 |
|