This commit is contained in:
ylzz1997 2023-04-06 22:37:54 +08:00
commit c1600668d3
3 changed files with 8 additions and 7 deletions

View File

@ -144,7 +144,6 @@ Optional parameters: see the next section
- `-a` | `--auto_predict_f0`: automatic pitch prediction for voice conversion, do not enable this when converting songs as it can cause serious pitch issues.
- `-cm` | `--cluster_model_path`: path to the clustering model, fill in any value if clustering is not trained.
- `-cr` | `--cluster_infer_ratio`: proportion of the clustering solution, range 0-1, fill in 0 if the clustering model is not trained.
- `-fmp` | `--f0_mean_pooling`: Whether the mean filter (pooling) is used for F0 to improve some matte sounds. Note that enabling this option causes reasoning to slow down.
## 🤔 Optional Settings

View File

@ -140,11 +140,10 @@ python inference_main.py -m "logs/44k/G_30400.pth" -c "configs/config.json" -n "
可选项部分:部分具体见下一节
+ `-lg` | `--linear_gradient`两段音频切片的交叉淡入长度如果强制切片后出现人声不连贯可调整该数值如果连贯建议采用默认值0单位为秒
+ `-fmp` | `--f0_mean_pooling`是否对F0使用均值滤波器(池化),对部分哑音可能有改善。注意,启动该选项会导致推理速度下降,默认关闭
+ `-fmp` | `--f0_mean_pooling`是否对F0使用均值滤波器(池化),对部分哑音有改善。注意,启动该选项会导致推理速度下降,默认关闭
+ `-a` | `--auto_predict_f0`:语音转换自动预测音高,转换歌声时不要打开这个会严重跑调
+ `-cm` | `--cluster_model_path`:聚类模型路径,如果没有训练聚类则随便填
+ `-cr` | `--cluster_infer_ratio`聚类方案占比范围0-1若没有训练聚类模型则默认0即可
+ `-fmp` | `--f0_mean_pooling`是否对F0使用均值滤波器(池化),对部分哑音有改善。注意,启动该选项会导致推理速度下降
## 🤔 可选项

View File

@ -49,10 +49,13 @@ def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise
model.clear_empty()
os.remove(temp_path)
#构建保存文件的路径并保存到results文件夹内
timestamp = str(int(time.time()))
output_file = os.path.join("results", sid + "_" + timestamp + ".wav")
soundfile.write(output_file, _audio, model.target_sample, format="wav")
return "Success", (model.target_sample, _audio)
try:
timestamp = str(int(time.time()))
output_file = os.path.join("./results", sid + "_" + timestamp + ".wav")
soundfile.write(output_file, _audio, model.target_sample, format="wav")
return "Success", (model.target_sample, _audio)
except Exception as e:
return "自动保存失败,请手动保存,音乐输出见下", (model.target_sample, _audio)
except Exception as e:
return "异常信息:"+str(e)+"\n请排障后重试",None