Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from gtts import gTTS | |
| import os | |
| def text_to_speech(text): | |
| # Convert text to speech | |
| tts = gTTS(text=text, lang='en') | |
| tts.save("output.mp3") | |
| return "output.mp3" | |
| # Create Gradio interface | |
| iface = gr.Interface(fn=text_to_speech, | |
| inputs="text", | |
| outputs="audio", | |
| title="Text to Speech", | |
| description="Enter text, and the system will read it aloud.") | |
| iface.launch() |