Skip to content

Commit

Permalink
Merge pull request svc-develop-team#115 from go22220203/patch-1
Browse files Browse the repository at this point in the history
Update webUI.py
  • Loading branch information
ricecakey06 authored Apr 3, 2023
2 parents f21f448 + 1304f9a commit ce08d86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from scipy.io import wavfile
import librosa
import torch
import time

logging.getLogger('numba').setLevel(logging.WARNING)
logging.getLogger('markdown_it').setLevel(logging.WARNING)
Expand Down Expand Up @@ -47,13 +48,18 @@ def vc_fn(sid, input_audio, vc_transform, auto_f0,cluster_ratio, slice_db, noise
_audio = model.slice_inference(temp_path, sid, vc_transform, slice_db, cluster_ratio, auto_f0, noise_scale,pad_seconds,cl_num,lg_num,lgr_num)
model.clear_empty()
os.remove(temp_path)
#构建保存文件的路径,并保存到raw文件夹内
timestamp = str(int(time.time()))
output_file = os.path.join("raw", sid + "_" + timestamp + ".wav")
soundfile.write(output_file, _audio, model.target_sample, format="wav")
return "Success", (model.target_sample, _audio)
except Exception as e:
return "异常信息:"+str(e)+"\n请排障后重试",None

def tts_func(_text,_rate):
#使用edge-tts把文字转成音频
# voice = "zh-CN-XiaoyiNeural"#女性,较高音
# voice = "zh-CN-YunxiNeural"#男性
voice = "zh-CN-YunxiNeural"#男性
output_file = _text[0:10]+".wav"
# communicate = edge_tts.Communicate(_text, voice)
Expand Down Expand Up @@ -163,4 +169,3 @@ def modelAnalysis(model_path,config_path,cluster_model_path,device):
app.launch()



0 comments on commit ce08d86

Please sign in to comment.