File size: 272 Bytes
2c1eba3
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import torch
from TTS.api import TTS


print(TTS().list_models())

# Init TTS
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to('cpu')


def speak(text):
    tts.tts_to_file(text=text, speaker_wav="speech.wav", language="en", file_path="output.wav")