import os from gtts import gTTS import gradio as gr def texttospeech(text, language='ko'): tts = gTTS(text=text, lang=language) tts.save("output.mp3") return "output.mp3" iface = gr.Interface( fn=texttospeech, inputs="text", outputs="audio", title="GTTS ", description="" ) if __name == "__main": iface.launch()