mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-01-19 18:41:52 +00:00
Format code (#455)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6f1bc7d683
commit
52c97ed464
15
MDXNet.py
15
MDXNet.py
@@ -206,25 +206,28 @@ class Predictor:
|
||||
mix = mix.T
|
||||
sources = self.demix(mix.T)
|
||||
opt = sources[0].T
|
||||
if(format in ["wav", "flac"]):
|
||||
sf.write("%s/%s_main_vocal.%s" % (vocal_root, basename, format), mix - opt, rate)
|
||||
if format in ["wav", "flac"]:
|
||||
sf.write(
|
||||
"%s/%s_main_vocal.%s" % (vocal_root, basename, format), mix - opt, rate
|
||||
)
|
||||
sf.write("%s/%s_others.%s" % (others_root, basename, format), opt, rate)
|
||||
else:
|
||||
path_vocal="%s/%s_main_vocal.wav" % (vocal_root, basename)
|
||||
path_other="%s/%s_others.wav" % (others_root, basename)
|
||||
path_vocal = "%s/%s_main_vocal.wav" % (vocal_root, basename)
|
||||
path_other = "%s/%s_others.wav" % (others_root, basename)
|
||||
sf.write(path_vocal, mix - opt, rate)
|
||||
sf.write(path_other, opt, rate)
|
||||
if (os.path.exists(path_vocal)):
|
||||
if os.path.exists(path_vocal):
|
||||
os.system(
|
||||
"ffmpeg -i %s -vn %s -q:a 2 -y"
|
||||
% (path_vocal, path_vocal[:-4] + ".%s" % format)
|
||||
)
|
||||
if (os.path.exists(path_other)):
|
||||
if os.path.exists(path_other):
|
||||
os.system(
|
||||
"ffmpeg -i %s -vn %s -q:a 2 -y"
|
||||
% (path_other, path_other[:-4] + ".%s" % format)
|
||||
)
|
||||
|
||||
|
||||
class MDXNetDereverb:
|
||||
def __init__(self, chunks):
|
||||
self.onnx = "uvr5_weights/onnx_dereverb_By_FoxJoy"
|
||||
|
||||
Reference in New Issue
Block a user