Spaces:
Runtime error
Runtime error
| from gtts import gTTS | |
| import gradio as gr | |
| import os | |
| def text_to_audio(text): | |
| # Generate audio from text using gTTS | |
| tts = gTTS(text=text, lang='en', tld="co.in",slow=False) | |
| tts.save("test.wav") | |
| return 'test.wav' | |
| iface = gr.Interface(fn = text_to_audio, | |
| inputs = 'text', | |
| outputs = 'audio', | |
| verbose = True, | |
| ) | |
| iface.launch() |