zxsipola123456 commited on
Commit
5c8f4fe
1 Parent(s): df85726

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -13
app.py CHANGED
@@ -128,23 +128,40 @@ with app:
128
  out1 = gr.Audio(type="filepath", label="AI变声后的专属音频")
129
  btn_text.click(tts, [inp_text, model, voice, api_key], inp1)
130
  btn1.click(voice_change, [inp1, inp2], out1)
131
- with gr.Tab("⚡ Edge TTS"):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  with gr.Row():
133
- input_text = gr.Textbox(lines=5, placeholder="请输入ai生成的文案,不要超过300字,最好200字左右", label="请填写您想生成的文本中英文皆可")
134
- default_language = list(language_dict.keys())[15]
135
- language = gr.Dropdown(choices=list(language_dict.keys()), value=default_language, label="请选择文本对应的语言")
136
- btn_edge = gr.Button("一键开启真实拟声吧", variant="primary")
137
- output_text = gr.Textbox(label="输出文本", visible=False)
138
- output_audio = gr.Audio(type="filepath", label="Edge TTS真实拟声")
139
-
 
140
  with gr.Row():
141
- inp_vc = gr.Audio(type="filepath", label="请上传AI变声的参照音频决定变声后的语音音色")
142
- btn_vc = gr.Button("一键开启AI变声吧", variant="primary")
143
- out_vc = gr.Audio(type="filepath", label="AI变声后的专属音频")
144
-
 
145
  btn_edge.click(lambda text, lang: anyio.run(text_to_speech_edge, text, lang), [input_text, language], [output_text, output_audio])
146
  btn_vc.click(voice_change, [output_audio, inp_vc], out_vc)
147
-
148
  gr.Markdown("### <center>注意获取中转API Key [here](https://buy.sipola.cn).</center>")
149
  gr.Markdown("### <center>ai文案生成可使用中转key,请访问 [here](https://ai.sipola.cn).</center>")
150
  gr.HTML('''
 
128
  out1 = gr.Audio(type="filepath", label="AI变声后的专属音频")
129
  btn_text.click(tts, [inp_text, model, voice, api_key], inp1)
130
  btn1.click(voice_change, [inp1, inp2], out1)
131
+ # with gr.Tab("⚡ Edge TTS"):
132
+ # with gr.Row():
133
+ # input_text = gr.Textbox(lines=5, placeholder="请输入ai生成的文案,不要超过300字,最好200字左右", label="请填写您想生成的文本中英文皆可")
134
+ # default_language = list(language_dict.keys())[15]
135
+ # language = gr.Dropdown(choices=list(language_dict.keys()), value=default_language, label="请选择文本对应的语言")
136
+ # btn_edge = gr.Button("一键开启真实拟声吧", variant="primary")
137
+ # output_text = gr.Textbox(label="输出文本", visible=False)
138
+ # output_audio = gr.Audio(type="filepath", label="Edge TTS真实拟声")
139
+
140
+ # with gr.Row():
141
+ # inp_vc = gr.Audio(type="filepath", label="请上传AI变声的参照音频决定变声后的语音音色")
142
+ # btn_vc = gr.Button("一键开启AI变声吧", variant="primary")
143
+ # out_vc = gr.Audio(type="filepath", label="AI变声后的专属音频")
144
+
145
+ # btn_edge.click(lambda text, lang: anyio.run(text_to_speech_edge, text, lang), [input_text, language], [output_text, output_audio])
146
+ # btn_vc.click(voice_change, [output_audio, inp_vc], out_vc)
147
+ with gr.Tab("Edge TTS"):
148
  with gr.Row():
149
+ with gr.Column():
150
+ input_text = gr.Textbox(label="请填写您想生成的文本中英文皆可",placeholder="请输入ai生成的文案,不要超过300字,最好200字左右",lines=5)
151
+ btn_edge = gr.Button("一键开启真实拟声吧", variant="primary")
152
+ with gr.Column():
153
+ default_language = list(language_dict.keys())[15]
154
+ language = gr.Dropdown(choices=list(language_dict.keys()), value=default_language, label="请选择文本对应的语言")
155
+ output_audio = gr.Audio(type="filepath", label="TTS真实拟声")
156
+ output_text = gr.Textbox(label="输出文本", visible=False)
157
  with gr.Row():
158
+ with gr.Column():
159
+ inp_vc = gr.Audio(type="filepath", label="请上传AI变声的参照音频决定变声后的语音音色")
160
+ btn_vc = gr.Button("一键开启AI变声吧", variant="primary")
161
+ with gr.Column():
162
+ out_vc = gr.Audio(type="filepath", label="AI变声后的专属音频")
163
  btn_edge.click(lambda text, lang: anyio.run(text_to_speech_edge, text, lang), [input_text, language], [output_text, output_audio])
164
  btn_vc.click(voice_change, [output_audio, inp_vc], out_vc)
 
165
  gr.Markdown("### <center>注意获取中转API Key [here](https://buy.sipola.cn).</center>")
166
  gr.Markdown("### <center>ai文案生成可使用中转key,请访问 [here](https://ai.sipola.cn).</center>")
167
  gr.HTML('''