Talha812 commited on
Commit
c0bf1f6
·
verified ·
1 Parent(s): 4a0871d

Create tts.py

Browse files
Files changed (1) hide show
  1. tts.py +10 -0
tts.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from gtts import gTTS
2
+
3
+ def text_to_speech(text):
4
+
5
+ output_file = "response.mp3"
6
+
7
+ tts = gTTS(text=text, lang="en")
8
+ tts.save(output_file)
9
+
10
+ return output_file