Spaces:
Build error
Build error
Commit
·
2f90547
1
Parent(s):
e491b4f
small fixes
Browse files
app.py
CHANGED
|
@@ -19,6 +19,7 @@
|
|
| 19 |
# References:
|
| 20 |
# https://gradio.app/docs/#dropdown
|
| 21 |
|
|
|
|
| 22 |
import logging
|
| 23 |
import os
|
| 24 |
import time
|
|
@@ -39,6 +40,10 @@ def convert_to_wav(in_filename: str) -> str:
|
|
| 39 |
out_filename = in_filename + ".wav"
|
| 40 |
logging.info(f"Converting '{in_filename}' to '{out_filename}'")
|
| 41 |
_ = os.system(f"ffmpeg -hide_banner -i '{in_filename}' -ar 16000 '{out_filename}'")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
return out_filename
|
| 43 |
|
| 44 |
|
|
|
|
| 19 |
# References:
|
| 20 |
# https://gradio.app/docs/#dropdown
|
| 21 |
|
| 22 |
+
import base64
|
| 23 |
import logging
|
| 24 |
import os
|
| 25 |
import time
|
|
|
|
| 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 |
+
with open(out_filename, "rb") as f:
|
| 44 |
+
s = "\n" + out_filename + "\n"
|
| 45 |
+
s += base64.b64encode(f.read())
|
| 46 |
+
logging.info(s)
|
| 47 |
return out_filename
|
| 48 |
|
| 49 |
|