File size: 475 Bytes
9a88d9c
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from TTS.api import TTS

tts = TTS(model_path="XTTS-v2_C3PO/", 
          config_path="XTTS-v2_C3PO/config.json", progress_bar=False, gpu=True).to(self.device)

# generate speech by cloning a voice using default settings
tts.tts_to_file(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.",
                file_path="output.wav",
                speaker_wav="/path/to/target/speaker.wav",
                language="en")