Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -11,10 +11,10 @@ zh_tts = TTS(model_name="tts_models/zh-CN/baker/tacotron2-DDC-GST", progress_bar
|
|
11 |
def text_to_speech(text: str, speaker_wav, language: str):
|
12 |
file_path = "output.wav"
|
13 |
if language == "zh-CN":
|
14 |
-
if speaker_wav is not None:
|
15 |
-
|
16 |
-
else:
|
17 |
-
|
18 |
# elif language == "de":
|
19 |
# if speaker_wav is not None:
|
20 |
# de_tts.tts_to_file(text, speaker_wav=speaker_wav, file_path=file_path)
|
@@ -33,7 +33,7 @@ def text_to_speech(text: str, speaker_wav, language: str):
|
|
33 |
return file_path
|
34 |
|
35 |
inputs = [gr.Textbox(label="Input the text", value="", max_lines=3),
|
36 |
-
gr.Audio(label="
|
37 |
gr.Radio(label="Language", choices=["en", "zh-CN", "fr-fr"], value="en")]
|
38 |
outputs = gr.Audio(label="Output")
|
39 |
|
|
|
11 |
def text_to_speech(text: str, speaker_wav, language: str):
|
12 |
file_path = "output.wav"
|
13 |
if language == "zh-CN":
|
14 |
+
# if speaker_wav is not None:
|
15 |
+
# zh_tts.tts_to_file(text, speaker_wav=speaker_wav, file_path=file_path)
|
16 |
+
# else:
|
17 |
+
zh_tts.tts_to_file(text, file_path=file_path)
|
18 |
# elif language == "de":
|
19 |
# if speaker_wav is not None:
|
20 |
# de_tts.tts_to_file(text, speaker_wav=speaker_wav, file_path=file_path)
|
|
|
33 |
return file_path
|
34 |
|
35 |
inputs = [gr.Textbox(label="Input the text", value="", max_lines=3),
|
36 |
+
gr.Audio(label="Voice to clone", source="microphone", type="filepath"),
|
37 |
gr.Radio(label="Language", choices=["en", "zh-CN", "fr-fr"], value="en")]
|
38 |
outputs = gr.Audio(label="Output")
|
39 |
|