Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -248,7 +248,7 @@ def download_audio(url, audio_name):
|
|
248 |
'format': 'bestaudio/best',
|
249 |
'postprocessors': [{
|
250 |
'key': 'FFmpegExtractAudio',
|
251 |
-
'preferredcodec': '
|
252 |
'preferredquality': '192',
|
253 |
}],
|
254 |
"outtmpl": f'audios/{audio_name}',
|
@@ -297,14 +297,8 @@ with gr.Blocks(theme="ParityError/Interstellar") as app:
|
|
297 |
|
298 |
with gr.Row():
|
299 |
with gr.Tabs():
|
300 |
-
with gr.TabItem("record audio:"):
|
301 |
-
recorder = gr.Microphone(label="Record audio here...",type='filepath')
|
302 |
with gr.TabItem("Choose an audio file:"):
|
303 |
audio_picker = gr.Dropdown(label="",choices=show_available('audios'),value='',interactive=True)
|
304 |
-
try:
|
305 |
-
recorder.stop_recording(upload_file, inputs=[recorder],outputs=[audio_picker])
|
306 |
-
except:
|
307 |
-
recorder.upload(upload_file, inputs=[recorder],outputs=[audio_picker])
|
308 |
with gr.TabItem("Or upload a new file here"):
|
309 |
try:
|
310 |
dropbox = gr.File(label="Drop an audio here.",file_types=['.wav', '.mp3', '.ogg', '.flac', '.aac'], type="filepath")
|
|
|
248 |
'format': 'bestaudio/best',
|
249 |
'postprocessors': [{
|
250 |
'key': 'FFmpegExtractAudio',
|
251 |
+
'preferredcodec': 'mp3',
|
252 |
'preferredquality': '192',
|
253 |
}],
|
254 |
"outtmpl": f'audios/{audio_name}',
|
|
|
297 |
|
298 |
with gr.Row():
|
299 |
with gr.Tabs():
|
|
|
|
|
300 |
with gr.TabItem("Choose an audio file:"):
|
301 |
audio_picker = gr.Dropdown(label="",choices=show_available('audios'),value='',interactive=True)
|
|
|
|
|
|
|
|
|
302 |
with gr.TabItem("Or upload a new file here"):
|
303 |
try:
|
304 |
dropbox = gr.File(label="Drop an audio here.",file_types=['.wav', '.mp3', '.ogg', '.flac', '.aac'], type="filepath")
|