File size: 521 Bytes
6da8f38
d96e497
6da8f38
d96e497
 
6da8f38
 
609f320
27e1a6e
609f320
 
 
 
 
 
76f1ec6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from fastapi import FastAPI

app = FastAPI()


@app.get("/")
async def root():
    from TTS.api import TTS
    tts = TTS("tts_models/multilingual/multi-dataset/xtts_v1", gpu=False)
    
    # 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")