Spaces:
Configuration error
Configuration error
Adding file test: app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,15 @@
|
|
| 1 |
-
|
| 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__":
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
from gtts import gTTS
|
| 3 |
|
| 4 |
def text_to_speech(text):
|
| 5 |
+
tts = gTTS(text=text, lang='en')
|
| 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 |
)
|
| 14 |
|
| 15 |
if __name__ == "__main__":
|