Spaces:
Sleeping
Sleeping
Download app.py from Rajor78/Transcript: direct link, hf CLI and curl.
- Browser
- Download file 533 Bytes
-
https://huggingface.co/spaces/Rajor78/Transcript/resolve/main/app.py
- Command line
-
hf download hf://spaces/Rajor78/Transcript/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Rajor78/Transcript/resolve/main/app.py
533 Bytes
| import gradio as gr | |
| from gtts import gTTS | |
| import os | |
| def text_to_speech(text): | |
| audio_file = "output.mp3" | |
| tts = gTTS(text, lang="es") | |
| tts.save(audio_file) | |
| return audio_file | |
| with gr.Blocks() as demo: | |
| gr.Markdown("# Conversor de Texto a Voz (TTS) en Español") | |
| text_input = gr.Textbox(label="Escribe tu texto aquí") | |
| output_audio = gr.Audio(label="Salida de Audio") | |
| submit_btn = gr.Button("Generar Audio") | |
| submit_btn.click(fn=text_to_speech, inputs=text_input, outputs=output_audio) | |
| demo.launch() | |