From ce38277539f2f58b74756d721d7176f47fef4106 Mon Sep 17 00:00:00 2001 From: EngsShi Date: Thu, 13 Apr 2023 03:31:53 +0800 Subject: [PATCH 1/2] add webUI.py input text clear fun edge-tts parameters must be pure --- webUI.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webUI.py b/webUI.py index 8fc29f2..14c2736 100644 --- a/webUI.py +++ b/webUI.py @@ -124,9 +124,12 @@ def tts_func(_text,_rate,_voice): p.wait() return output_file +def text_clear(text): + return re.sub(r"[\n\,\(\) ]", "", text) def vc_fn2(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise_scale,pad_seconds,cl_num,lg_num,lgr_num,text2tts,tts_rate,tts_voice,F0_mean_pooling,enhancer_adaptive_key): #使用edge-tts把文字转成音频 + text2tts=text_clear(text2tts) output_file=tts_func(text2tts,tts_rate,tts_voice) #调整采样率 From 4b27899f5383709b4200a838eb13b74a1b5975fd Mon Sep 17 00:00:00 2001 From: EngsShi Date: Thu, 13 Apr 2023 03:34:33 +0800 Subject: [PATCH 2/2] remove double btn --- webUI.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webUI.py b/webUI.py index 14c2736..af2aa72 100644 --- a/webUI.py +++ b/webUI.py @@ -224,9 +224,8 @@ with gr.Blocks( """) debug_button = gr.Checkbox(label="Debug模式,如果向社区反馈BUG需要打开,打开后控制台可以显示具体错误提示", value=debug) vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale,pad_seconds,cl_num,lg_num,lgr_num,F0_mean_pooling,enhancer_adaptive_key], [vc_output1, vc_output2]) - vc_submit2.click(vc_fn2, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale,pad_seconds,cl_num,lg_num,lgr_num,text2tts,tts_rate,F0_mean_pooling,enhancer_adaptive_key], [vc_output1, vc_output2]) - debug_button.change(debug_change,[],[]) vc_submit2.click(vc_fn2, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale,pad_seconds,cl_num,lg_num,lgr_num,text2tts,tts_rate,tts_voice,F0_mean_pooling,enhancer_adaptive_key], [vc_output1, vc_output2]) + debug_button.change(debug_change,[],[]) model_load_button.click(modelAnalysis,[model_path,config_path,cluster_model_path,device,enhance],[sid,sid_output]) model_unload_button.click(modelUnload,[],[sid,sid_output]) app.launch()