File size: 178 Bytes
090be3b
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
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