LeeNight
commited on
Commit
•
fd90cb6
1
Parent(s):
9a7bb7f
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ model = Svc("logs/44k/G_90400.pth", "configs/config.json", cluster_model_path="l
|
|
22 |
|
23 |
def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise_scale):
|
24 |
if input_audio is None:
|
25 |
-
return "
|
26 |
sampling_rate, audio = input_audio
|
27 |
# print(audio.shape,sampling_rate)
|
28 |
duration = audio.shape[0] / sampling_rate
|
@@ -38,7 +38,7 @@ def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise
|
|
38 |
soundfile.write(out_wav_path, audio, 16000, format="wav")
|
39 |
print( cluster_ratio, auto_f0, noise_scale)
|
40 |
_audio = model.slice_inference(out_wav_path, sid, vc_transform, slice_db, cluster_ratio, auto_f0, noise_scale)
|
41 |
-
return "
|
42 |
|
43 |
|
44 |
app = gr.Blocks()
|
@@ -70,7 +70,7 @@ with app:
|
|
70 |
slice_db = gr.Number(label="切片阈值", value=-40)
|
71 |
noise_scale = gr.Number(label="noise_scale 建议不要动,会影响音质,玄学参数", value=0.4)
|
72 |
vc_submit = gr.Button("转换", variant="primary")
|
73 |
-
vc_output1 = gr.Textbox(label="
|
74 |
vc_output2 = gr.Audio(label="Output Audio")
|
75 |
vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale], [vc_output1, vc_output2])
|
76 |
|
|
|
22 |
|
23 |
def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise_scale):
|
24 |
if input_audio is None:
|
25 |
+
return "没有上传待处理的音频哦", None
|
26 |
sampling_rate, audio = input_audio
|
27 |
# print(audio.shape,sampling_rate)
|
28 |
duration = audio.shape[0] / sampling_rate
|
|
|
38 |
soundfile.write(out_wav_path, audio, 16000, format="wav")
|
39 |
print( cluster_ratio, auto_f0, noise_scale)
|
40 |
_audio = model.slice_inference(out_wav_path, sid, vc_transform, slice_db, cluster_ratio, auto_f0, noise_scale)
|
41 |
+
return "转换完成", (44100, _audio)
|
42 |
|
43 |
|
44 |
app = gr.Blocks()
|
|
|
70 |
slice_db = gr.Number(label="切片阈值", value=-40)
|
71 |
noise_scale = gr.Number(label="noise_scale 建议不要动,会影响音质,玄学参数", value=0.4)
|
72 |
vc_submit = gr.Button("转换", variant="primary")
|
73 |
+
vc_output1 = gr.Textbox(label="输出结果")
|
74 |
vc_output2 = gr.Audio(label="Output Audio")
|
75 |
vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,auto_f0,cluster_ratio, slice_db, noise_scale], [vc_output1, vc_output2])
|
76 |
|