Spaces:
Configuration error
Configuration error
Adding file test: app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,18 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
from gtts import gTTS
|
| 3 |
-
import os
|
| 4 |
|
| 5 |
-
def text_to_speech(text
|
| 6 |
-
tts = gTTS(text
|
| 7 |
tts.save("output.mp3")
|
| 8 |
return "output.mp3"
|
| 9 |
|
| 10 |
iface = gr.Interface(
|
| 11 |
fn=text_to_speech,
|
| 12 |
-
inputs=
|
| 13 |
-
gr.inputs.Textbox(lines=2, placeholder="Enter text here..."),
|
| 14 |
-
gr.inputs.Radio(["en", "es", "fr", "de", "it", "pt"], label="Language", default="en")
|
| 15 |
-
],
|
| 16 |
outputs="audio",
|
| 17 |
title="Text to Speech Converter",
|
| 18 |
-
description="
|
| 19 |
)
|
| 20 |
|
| 21 |
if __name__ == "__main__":
|
| 22 |
-
iface.launch()
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
from gtts import gTTS
|
|
|
|
| 3 |
|
| 4 |
+
def text_to_speech(text):
|
| 5 |
+
tts = gTTS(text)
|
| 6 |
tts.save("output.mp3")
|
| 7 |
return "output.mp3"
|
| 8 |
|
| 9 |
iface = gr.Interface(
|
| 10 |
fn=text_to_speech,
|
| 11 |
+
inputs="text",
|
|
|
|
|
|
|
|
|
|
| 12 |
outputs="audio",
|
| 13 |
title="Text to Speech Converter",
|
| 14 |
+
description="Enter text and convert it to speech."
|
| 15 |
)
|
| 16 |
|
| 17 |
if __name__ == "__main__":
|
| 18 |
+
iface.launch()
|