Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -5,5 +5,12 @@ app = FastAPI()
|
|
5 |
|
6 |
@app.get("/")
|
7 |
async def root():
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|