Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from gtts import gTTS
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
def text_to_speech(text, language='ko'):
|
6 |
+
tts = gTTS(text=text, lang=language)
|
7 |
+
tts.save("output.mp3")
|
8 |
+
return "output.mp3"
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=text_to_speech,
|
12 |
+
inputs="text",
|
13 |
+
outputs="audio",
|
14 |
+
title="GTTS ",
|
15 |
+
description=""
|
16 |
+
)
|
17 |
+
|
18 |
+
if __name__ == "__main__":
|
19 |
+
iface.launch()
|