Spaces:
Sleeping
Sleeping
Commit
·
58a2f85
1
Parent(s):
f056f8e
Hot reload enabled
Browse filesDevs are happier with this feature.
app.py
CHANGED
|
@@ -13,8 +13,6 @@ voice = PiperVoice.load(model_path, config_path)
|
|
| 13 |
|
| 14 |
|
| 15 |
def synthesize_speech(text):
|
| 16 |
-
|
| 17 |
-
|
| 18 |
# Create an in-memory buffer for the WAV file
|
| 19 |
buffer = BytesIO()
|
| 20 |
with wave.open(buffer, 'wb') as wav_file:
|
|
@@ -51,7 +49,7 @@ on [piper's shoulders](https://huggingface.co/rhasspy/piper-voices) by [rhasspy]
|
|
| 51 |
"""
|
| 52 |
|
| 53 |
# Using Gradio Blocks
|
| 54 |
-
with gr.Blocks(theme=gr.themes.Base()) as
|
| 55 |
gr.Markdown(BANNER_TEXT)
|
| 56 |
input_text = gr.Textbox(label=" ", placeholder="Introduce el texto a leer aquí")
|
| 57 |
output_audio = gr.Audio(label="Audio generado", type="numpy")
|
|
@@ -60,5 +58,6 @@ with gr.Blocks(theme=gr.themes.Base()) as blocks:
|
|
| 60 |
gr.Markdown(FOOTER_TEXT)
|
| 61 |
|
| 62 |
submit_button.click(synthesize_speech, inputs=input_text, outputs=[output_audio, output_text])
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
def synthesize_speech(text):
|
|
|
|
|
|
|
| 16 |
# Create an in-memory buffer for the WAV file
|
| 17 |
buffer = BytesIO()
|
| 18 |
with wave.open(buffer, 'wb') as wav_file:
|
|
|
|
| 49 |
"""
|
| 50 |
|
| 51 |
# Using Gradio Blocks
|
| 52 |
+
with gr.Blocks(theme=gr.themes.Base()) as demo:
|
| 53 |
gr.Markdown(BANNER_TEXT)
|
| 54 |
input_text = gr.Textbox(label=" ", placeholder="Introduce el texto a leer aquí")
|
| 55 |
output_audio = gr.Audio(label="Audio generado", type="numpy")
|
|
|
|
| 58 |
gr.Markdown(FOOTER_TEXT)
|
| 59 |
|
| 60 |
submit_button.click(synthesize_speech, inputs=input_text, outputs=[output_audio, output_text])
|
| 61 |
+
|
| 62 |
+
if __name__ == '__main__':
|
| 63 |
+
demo.launch()
|