avin-255 commited on
Commit
7cb72a8
·
verified ·
1 Parent(s): ab591a9
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -1 +1,14 @@
1
- print("hello world")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from gtts import gTTS
2
+ import os
3
+ import gradio as gr
4
+ import tempfile
5
+
6
+ def speak(text):
7
+ tts = gTTS(text)
8
+ with
9
+ tempfile.NamedTemporaryFile(delete=False, suffix=".mp3") as tmp:
10
+ tts.save(tmp.name)
11
+ return tmp.name
12
+
13
+ app = gr.Interface(fn=speak, inputs="text", outputs="audio", title="avin-speech")
14
+ app.launch()