Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,7 @@ def get_speakers(language):
|
|
32 |
speakers = list(language_dict[language].keys())
|
33 |
return gr.Dropdown(choices=speakers, value=speakers[0], label="Speakers", interactive=True), gr.Checkbox(label="Tashkeel", value=False, visible=False, interactive=False)
|
34 |
|
35 |
-
|
36 |
-
with gr.Blocks() as demo:
|
37 |
gr.Markdown("# English Text-to-Speech (Edge TTS)")
|
38 |
gr.Markdown("Convert English text to speech using Edge TTS. Choose a speaker and optionally add tashkeel.")
|
39 |
|
@@ -50,14 +49,11 @@ with gr.Blocks() as demo:
|
|
50 |
input_text.change(lambda text: f"<p>Characters: {len(text)}</p>", inputs=[input_text], outputs=[character_counter])
|
51 |
|
52 |
with gr.Row():
|
53 |
-
gr.Button("Convert Text to Speech")
|
|
|
54 |
text_to_speech_edge,
|
55 |
inputs=[input_text, speakers_dropdown, tashkeel_checkbox],
|
56 |
outputs=[output_text, output_audio]
|
57 |
)
|
58 |
|
59 |
-
# Add custom themes and additional elements
|
60 |
-
demo.theme = "default"
|
61 |
-
demo.description = "Convert English text to speech using Edge TTS. Choose a speaker and optionally add tashkeel."
|
62 |
-
|
63 |
demo.launch(share=False)
|
|
|
32 |
speakers = list(language_dict[language].keys())
|
33 |
return gr.Dropdown(choices=speakers, value=speakers[0], label="Speakers", interactive=True), gr.Checkbox(label="Tashkeel", value=False, visible=False, interactive=False)
|
34 |
|
35 |
+
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
|
|
36 |
gr.Markdown("# English Text-to-Speech (Edge TTS)")
|
37 |
gr.Markdown("Convert English text to speech using Edge TTS. Choose a speaker and optionally add tashkeel.")
|
38 |
|
|
|
49 |
input_text.change(lambda text: f"<p>Characters: {len(text)}</p>", inputs=[input_text], outputs=[character_counter])
|
50 |
|
51 |
with gr.Row():
|
52 |
+
convert_button = gr.Button("Convert Text to Speech")
|
53 |
+
convert_button.click(
|
54 |
text_to_speech_edge,
|
55 |
inputs=[input_text, speakers_dropdown, tashkeel_checkbox],
|
56 |
outputs=[output_text, output_audio]
|
57 |
)
|
58 |
|
|
|
|
|
|
|
|
|
59 |
demo.launch(share=False)
|