Skip to content

Commit 4aa2a89

Browse files
authored
Merge pull request RVC-Project#2177 from AurevoirXavier/main
fix: allow path name contains special characters
2 parents 5524451 + 81ca325 commit 4aa2a89

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

infer/modules/uvr5/mdxnet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def prediction(self, m, vocal_root, others_root, format):
220220
opt_path_other = path_other[:-4] + ".%s" % format
221221
if os.path.exists(path_vocal):
222222
os.system(
223-
"ffmpeg -i %s -vn %s -q:a 2 -y" % (path_vocal, opt_path_vocal)
223+
'ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path_vocal, opt_path_vocal)
224224
)
225225
if os.path.exists(opt_path_vocal):
226226
try:
@@ -229,7 +229,7 @@ def prediction(self, m, vocal_root, others_root, format):
229229
pass
230230
if os.path.exists(path_other):
231231
os.system(
232-
"ffmpeg -i %s -vn %s -q:a 2 -y" % (path_other, opt_path_other)
232+
'ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path_other, opt_path_other)
233233
)
234234
if os.path.exists(opt_path_other):
235235
try:

infer/modules/uvr5/modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def uvr(model_name, inp_root, save_root_vocal, paths, save_root_ins, agg, format
6565
os.path.basename(inp_path),
6666
)
6767
os.system(
68-
"ffmpeg -i %s -vn -acodec pcm_s16le -ac 2 -ar 44100 %s -y"
68+
'ffmpeg -i "%s" -vn -acodec pcm_s16le -ac 2 -ar 44100 "%s" -y'
6969
% (inp_path, tmp_path)
7070
)
7171
inp_path = tmp_path

infer/modules/uvr5/vr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def _path_audio_(
146146
)
147147
if os.path.exists(path):
148148
opt_format_path = path[:-4] + ".%s" % format
149-
os.system("ffmpeg -i %s -vn %s -q:a 2 -y" % (path, opt_format_path))
149+
os.system('ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path, opt_format_path))
150150
if os.path.exists(opt_format_path):
151151
try:
152152
os.remove(path)
@@ -187,7 +187,7 @@ def _path_audio_(
187187
)
188188
if os.path.exists(path):
189189
opt_format_path = path[:-4] + ".%s" % format
190-
os.system("ffmpeg -i %s -vn %s -q:a 2 -y" % (path, opt_format_path))
190+
os.system('ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path, opt_format_path))
191191
if os.path.exists(opt_format_path):
192192
try:
193193
os.remove(path)
@@ -323,7 +323,7 @@ def _path_audio_(
323323
)
324324
if os.path.exists(path):
325325
opt_format_path = path[:-4] + ".%s" % format
326-
os.system("ffmpeg -i %s -vn %s -q:a 2 -y" % (path, opt_format_path))
326+
os.system('ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path, opt_format_path))
327327
if os.path.exists(opt_format_path):
328328
try:
329329
os.remove(path)
@@ -360,7 +360,7 @@ def _path_audio_(
360360
)
361361
if os.path.exists(path):
362362
opt_format_path = path[:-4] + ".%s" % format
363-
os.system("ffmpeg -i %s -vn %s -q:a 2 -y" % (path, opt_format_path))
363+
os.system('ffmpeg -i "%s" -vn "%s" -q:a 2 -y' % (path, opt_format_path))
364364
if os.path.exists(opt_format_path):
365365
try:
366366
os.remove(path)

0 commit comments

Comments
 (0)