Spaces:
Sleeping
Sleeping
Commit ·
d24ab7c
1
Parent(s): 2ca342a
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ import anyio
|
|
| 7 |
|
| 8 |
language_dict = {'普通话 (中国大陆)-Yunxi-男': 'zh-CN-YunxiNeural','普通话 (中国大陆)-Xiaoyi-女': 'zh-CN-XiaoyiNeural'}
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
voice = language_dict[language_code]
|
| 13 |
print(voice)
|
|
@@ -25,7 +25,7 @@ input_text = gr.Textbox(lines=5, label="输入文本")
|
|
| 25 |
output_text = gr.Textbox(label="输出文本")
|
| 26 |
output_audio = gr.Audio(type="filepath", label="导出文件")
|
| 27 |
|
| 28 |
-
language = gr.Dropdown(choices=list(language_dict.keys()),
|
| 29 |
|
| 30 |
interface = gr.Interface(fn=text_to_speech_edge, inputs=[input_text, language], outputs=[output_text, output_audio], title="LZZ文字转语音")
|
| 31 |
|
|
|
|
| 7 |
|
| 8 |
language_dict = {'普通话 (中国大陆)-Yunxi-男': 'zh-CN-YunxiNeural','普通话 (中国大陆)-Xiaoyi-女': 'zh-CN-XiaoyiNeural'}
|
| 9 |
|
| 10 |
+
def text_to_speech_edge(text, language_code):
|
| 11 |
|
| 12 |
voice = language_dict[language_code]
|
| 13 |
print(voice)
|
|
|
|
| 25 |
output_text = gr.Textbox(label="输出文本")
|
| 26 |
output_audio = gr.Audio(type="filepath", label="导出文件")
|
| 27 |
|
| 28 |
+
language = gr.Dropdown(choices=list(language_dict.keys()), label="语言")
|
| 29 |
|
| 30 |
interface = gr.Interface(fn=text_to_speech_edge, inputs=[input_text, language], outputs=[output_text, output_audio], title="LZZ文字转语音")
|
| 31 |
|