File size: 358 Bytes
e9f0caf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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() |