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