SefyanKehail
commited on
Commit
·
1db8dea
1
Parent(s):
cdbe445
added progress instead of spinner
Browse files
app.py
CHANGED
|
@@ -84,7 +84,7 @@ def gui():
|
|
| 84 |
|
| 85 |
with gr.Row():
|
| 86 |
with gr.Column():
|
| 87 |
-
audio_input = gr.Audio(type="filepath", label="Upload Audio", sources=["
|
| 88 |
convert_button = gr.Button("Convert Speech", interactive=True)
|
| 89 |
info = gr.Markdown("", visible=False)
|
| 90 |
|
|
@@ -95,9 +95,10 @@ def gui():
|
|
| 95 |
# audio_input.pause(stop_recording_info, inputs=[audio_input, info], outputs=[info])
|
| 96 |
|
| 97 |
# audio_input.change(enable_convert_button, inputs=[audio_input], outputs=[convert_button, info])
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
|
|
|
| 101 |
# audio_input.clear(clear_components, inputs=None, outputs=[audio_input, converted_audio])
|
| 102 |
|
| 103 |
# audio_input.change(enable_convert_button, inputs=[audio_input], outputs=[convert_button, info])
|
|
|
|
| 84 |
|
| 85 |
with gr.Row():
|
| 86 |
with gr.Column():
|
| 87 |
+
audio_input = gr.Audio(type="filepath", label="Upload Audio", sources=["upload", "microphone"], streaming=False, type="numpy")
|
| 88 |
convert_button = gr.Button("Convert Speech", interactive=True)
|
| 89 |
info = gr.Markdown("", visible=False)
|
| 90 |
|
|
|
|
| 95 |
# audio_input.pause(stop_recording_info, inputs=[audio_input, info], outputs=[info])
|
| 96 |
|
| 97 |
# audio_input.change(enable_convert_button, inputs=[audio_input], outputs=[convert_button, info])
|
| 98 |
+
try:
|
| 99 |
+
convert_button.click(convert_speech, inputs=[audio_input], outputs=[converted_audio])
|
| 100 |
+
except:
|
| 101 |
+
gr.Warning("Please upload an audio, or use the built-in microphone")
|
| 102 |
# audio_input.clear(clear_components, inputs=None, outputs=[audio_input, converted_audio])
|
| 103 |
|
| 104 |
# audio_input.change(enable_convert_button, inputs=[audio_input], outputs=[convert_button, info])
|