voicekkk / utils /tts.py
prasanth345's picture
Create utils/tts.py
090be3b verified
raw
history blame contribute delete
178 Bytes
from gtts import gTTS
import os
def text_to_speech(text):
tts = gTTS(text=text, lang="en")
output_path = "response.mp3"
tts.save(output_path)
return output_path