Spaces:
Runtime error
Runtime error
Update texttospeech.py
Browse files- texttospeech.py +12 -12
texttospeech.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
import torch
|
2 |
-
from TTS.api import TTS
|
3 |
-
|
4 |
-
|
5 |
-
print(TTS().list_models())
|
6 |
-
|
7 |
-
# Init TTS
|
8 |
-
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to('cpu')
|
9 |
-
|
10 |
-
|
11 |
-
def speak(text):
|
12 |
-
tts.tts_to_file(text=text, speaker_wav="speech.wav", language=
|
|
|
1 |
+
import torch
|
2 |
+
from TTS.api import TTS
|
3 |
+
|
4 |
+
|
5 |
+
print(TTS().list_models())
|
6 |
+
|
7 |
+
# Init TTS
|
8 |
+
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to('cpu')
|
9 |
+
|
10 |
+
|
11 |
+
def speak(text,lang):
|
12 |
+
tts.tts_to_file(text=text, speaker_wav="speech.wav", language=lang, file_path="output.wav")
|