Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -56,6 +56,9 @@ def change_color(text_input):
|
|
56 |
def clear_color(text_input, radio,error_box):
|
57 |
return gr.update(elem_id="alert"), gr.update(value="mic"), gr.update(visible=False)
|
58 |
|
|
|
|
|
|
|
59 |
|
60 |
with gr.Blocks(css="footer {visibility: hidden}") as demo:
|
61 |
with gr.Row():
|
@@ -73,10 +76,10 @@ with gr.Blocks(css="footer {visibility: hidden}") as demo:
|
|
73 |
btn = gr.Button("Generate", variant="primary")
|
74 |
with gr.Column():
|
75 |
audio_output = gr.Audio(label="Output", visible=True, autoplay=True, show_share_button=False)
|
76 |
-
down_btn = gr.DownloadButton("Download the file", visible=
|
77 |
error_box = gr.Textbox(label="WARNING", value="Input box cannot be blank!!", visible=False, container=True)
|
78 |
|
79 |
-
down_btn.click
|
80 |
btn_clear.add(audio_output)
|
81 |
btn.click(text_to_speech, inputs=[text_input, audio_input_mic, audio_input_file], outputs=audio_output)
|
82 |
btn.click(show_error, text_input, [error_box, audio_output])
|
|
|
56 |
def clear_color(text_input, radio,error_box):
|
57 |
return gr.update(elem_id="alert"), gr.update(value="mic"), gr.update(visible=False)
|
58 |
|
59 |
+
def download_file():
|
60 |
+
return [gr.DownloadButton(visible=False)]
|
61 |
+
|
62 |
|
63 |
with gr.Blocks(css="footer {visibility: hidden}") as demo:
|
64 |
with gr.Row():
|
|
|
76 |
btn = gr.Button("Generate", variant="primary")
|
77 |
with gr.Column():
|
78 |
audio_output = gr.Audio(label="Output", visible=True, autoplay=True, show_share_button=False)
|
79 |
+
down_btn = gr.DownloadButton("Download the file", visible=True)
|
80 |
error_box = gr.Textbox(label="WARNING", value="Input box cannot be blank!!", visible=False, container=True)
|
81 |
|
82 |
+
down_btn.click(download_file, None)
|
83 |
btn_clear.add(audio_output)
|
84 |
btn.click(text_to_speech, inputs=[text_input, audio_input_mic, audio_input_file], outputs=audio_output)
|
85 |
btn.click(show_error, text_input, [error_box, audio_output])
|