Suparnpreet commited on
Commit
942a97e
·
verified ·
1 Parent(s): 1e8dd1f

Update texttospeech.py

Browse files
Files changed (1) hide show
  1. 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="en", file_path="output.wav")
 
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")