ragha108's picture
Update app.py
622f99a
raw
history blame
426 Bytes
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()