File size: 207 Bytes
e792350
 
 
 
 
 
 
1
2
3
4
5
6
7
8
from TTS.api import TTS

tts = TTS(model_name="tts_models/en/ljspeech/tacotron2-DDC", gpu=False)

def generate_voice(text, path="podcast.wav"):
    tts.tts_to_file(text=text, file_path=path)
    return path