darwincharles123321 commited on
Commit
c7557ed
·
verified ·
1 Parent(s): 8d893ea

Create utils/tts.py

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