Create utils/tts.py
Browse files- 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
|