bilal01 commited on
Commit
609f320
·
1 Parent(s): 95b7136

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -1
main.py CHANGED
@@ -5,5 +5,12 @@ app = FastAPI()
5
 
6
  @app.get("/")
7
  async def root():
8
- return {"message": "Hello World"}
 
 
 
 
 
 
 
9
 
 
5
 
6
  @app.get("/")
7
  async def root():
8
+ from TTS.api import TTS
9
+ tts = TTS("tts_models/multilingual/multi-dataset/xtts_v1", gpu=True)
10
+
11
+ # generate speech by cloning a voice using default settings
12
+ 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.",
13
+ file_path="output.wav",
14
+ speaker_wav="/path/to/target/speaker.wav",
15
+ language="en")
16