Views
No views yet
1from TTS.api import TTS
2
3# Load the model
4tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=True)
5
6# Generate speech by cloning a voice using default settings
7tts.tts_to_file(
8 text="It took me quite a long time to develop a voice, and now that I have it I'm not going to be silent.",
9 file_path="output.wav",
10 speaker_wav="/path/to/target/speaker.wav",
11 language="hi"
12)