Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,8 @@ def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise
|
|
27 |
sampling_rate, audio = input_audio
|
28 |
# print(audio.shape,sampling_rate)
|
29 |
duration = audio.shape[0] / sampling_rate
|
30 |
-
if duration > 90:
|
31 |
-
|
32 |
audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
|
33 |
if len(audio.shape) > 1:
|
34 |
audio = librosa.to_mono(audio.transpose(1, 0))
|
@@ -53,7 +53,7 @@ with app:
|
|
53 |
""")
|
54 |
spks = list(model.spk2id.keys())
|
55 |
sid = gr.Dropdown(label="音色", choices=spks, value=spks[0])
|
56 |
-
vc_input3 = gr.Audio(label="
|
57 |
vc_transform = gr.Number(label="变调(整数,可以正负,半音数量,升高八度就是12)", value=0)
|
58 |
cluster_ratio = gr.Number(label="聚类模型混合比例,0-1之间,默认为0不启用聚类,能提升音色相似度,但会导致咬字下降(如果使用建议0.5左右)", value=0)
|
59 |
auto_f0 = gr.Checkbox(label="自动f0预测,配合聚类模型f0预测效果更好,会导致变调功能失效(仅限转换语音,歌声不要勾选此项会究极跑调)", value=False)
|
|
|
27 |
sampling_rate, audio = input_audio
|
28 |
# print(audio.shape,sampling_rate)
|
29 |
duration = audio.shape[0] / sampling_rate
|
30 |
+
# if duration > 90:
|
31 |
+
# return "请上传小于90s的音频,需要转换长音频请本地进行转换", None
|
32 |
audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
|
33 |
if len(audio.shape) > 1:
|
34 |
audio = librosa.to_mono(audio.transpose(1, 0))
|
|
|
53 |
""")
|
54 |
spks = list(model.spk2id.keys())
|
55 |
sid = gr.Dropdown(label="音色", choices=spks, value=spks[0])
|
56 |
+
vc_input3 = gr.Audio(label="上传音频") # (长度小于90秒)
|
57 |
vc_transform = gr.Number(label="变调(整数,可以正负,半音数量,升高八度就是12)", value=0)
|
58 |
cluster_ratio = gr.Number(label="聚类模型混合比例,0-1之间,默认为0不启用聚类,能提升音色相似度,但会导致咬字下降(如果使用建议0.5左右)", value=0)
|
59 |
auto_f0 = gr.Checkbox(label="自动f0预测,配合聚类模型f0预测效果更好,会导致变调功能失效(仅限转换语音,歌声不要勾选此项会究极跑调)", value=False)
|