Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,19 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from gtts import gTTS
|
| 3 |
import os
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
def
|
| 6 |
tts = gTTS(text=text, lang=language)
|
| 7 |
tts.save("output.mp3")
|
| 8 |
-
|
| 9 |
|
| 10 |
iface = gr.Interface(
|
| 11 |
-
fn=
|
| 12 |
-
inputs=
|
| 13 |
outputs="audio",
|
| 14 |
-
title="
|
| 15 |
-
description="
|
| 16 |
-
examples=[["์๋
ํ์ธ์, ์ธ๊ณ!", "ko"], ["Bonjour, monde!", "fr"]],
|
| 17 |
-
allow_flagging="never"
|
| 18 |
)
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
+
from gtts import gTTS
|
| 3 |
+
import gradio as gr
|
| 4 |
|
| 5 |
+
def texttospeech(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=texttospeech,
|
| 12 |
+
inputs="text",
|
| 13 |
outputs="audio",
|
| 14 |
+
title="GTTS ",
|
| 15 |
+
description=""
|
|
|
|
|
|
|
| 16 |
)
|
| 17 |
|
| 18 |
+
if __name == "__main":
|
| 19 |
+
iface.launch()
|