Usman06 commited on
Commit
d5085a3
·
verified ·
1 Parent(s): fb4ef1e

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +20 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app.py
2
+
3
+ from gtts import gTTS
4
+ import gradio as gr
5
+ import os
6
+
7
+ def text_to_speech(text):
8
+ tts = gTTS(text)
9
+ tts.save("output.mp3")
10
+ return "output.mp3"
11
+
12
+ interface = gr.Interface(
13
+ fn=text_to_speech,
14
+ inputs=gr.Textbox(lines=3, label="Enter Text"),
15
+ outputs=gr.Audio(type="filepath", label="Generated Speech"),
16
+ title="Text to Speech App",
17
+ description="Enter any English text and listen to the speech output."
18
+ )
19
+
20
+ interface.launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ gradio
2
+ gTTS