Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -4,14 +4,13 @@ from TTS.api import TTS
|
|
4 |
# List available 🐸TTS models and choose the first one
|
5 |
model_name = TTS.list_models()[0]
|
6 |
# Init TTS
|
7 |
-
tts = TTS(model_name)
|
8 |
|
9 |
def text_to_speech(text: str, speaker_wav, language: str):
|
10 |
tts.tts_to_file(text, speaker_wav=speaker_wav, language=language, file_path="output.wav")
|
11 |
-
# tts.tts_to_file(text=text, speaker=tts.speakers[0], language=language, file_path="output.wav")
|
12 |
return 'output.wav'
|
13 |
|
14 |
-
inputs = [gr.Textbox(label="Input", value="
|
15 |
gr.Audio(Lable="Speaker Wav", source="microphone", type="filepath"),
|
16 |
gr.Radio(label="Language", choices=tts.languages, value="en")]
|
17 |
outputs = gr.Audio(label="Output")
|
|
|
4 |
# List available 🐸TTS models and choose the first one
|
5 |
model_name = TTS.list_models()[0]
|
6 |
# Init TTS
|
7 |
+
tts = TTS(model_name, progress_bar=True, gpu=False)
|
8 |
|
9 |
def text_to_speech(text: str, speaker_wav, language: str):
|
10 |
tts.tts_to_file(text, speaker_wav=speaker_wav, language=language, file_path="output.wav")
|
|
|
11 |
return 'output.wav'
|
12 |
|
13 |
+
inputs = [gr.Textbox(label="Input", value="Hello!", max_lines=3),
|
14 |
gr.Audio(Lable="Speaker Wav", source="microphone", type="filepath"),
|
15 |
gr.Radio(label="Language", choices=tts.languages, value="en")]
|
16 |
outputs = gr.Audio(label="Output")
|