prasanth345 commited on
Commit
090be3b
·
verified ·
1 Parent(s): 3bc3f66

Create utils/tts.py

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