Space0 / app.py
Raven7's picture
Create app.py
e9f0caf verified
raw
history blame contribute delete
358 Bytes
import os
from gtts import gTTS
import gradio as gr
def text_to_speech(text, language='ko'):
tts = gTTS(text=text, lang=language)
tts.save("output.mp3")
return "output.mp3"
iface = gr.Interface(
fn=text_to_speech,
inputs="text",
outputs="audio",
title="GTTS ",
description=""
)
if __name__ == "__main__":
iface.launch()