Spaces:
Running
Running
Download app.py from VICTUSOMEN/first: direct link, hf CLI and curl.
- Browser
- Download file 562 Bytes
-
https://huggingface.co/spaces/VICTUSOMEN/first/resolve/main/app.py
- Command line
-
hf download hf://spaces/VICTUSOMEN/first/app.py
-
curl -L -o app.py https://huggingface.co/spaces/VICTUSOMEN/first/resolve/main/app.py
562 Bytes
| from gtts import gTTS | |
| import gradio as gr | |
| import tempfile | |
| import os | |
| def speak(text): | |
| # Generate audio from text using Google TTS | |
| with tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as fp: | |
| tts = gTTS(text) | |
| tts.save(fp.name) | |
| return fp.name | |
| gr.Interface( | |
| fn=speak, | |
| inputs=gr.Textbox(label="Enter text to speak"), | |
| outputs=gr.Audio(type="filepath", label="Spoken Output"), | |
| title="Text-to-Speech Agent 🎙️", | |
| description="Type text and hear AI speak it aloud!", | |
| allow_flagging="never", | |
| ).launch() | |