mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2024-12-29 02:55:05 +08:00
移除音频文件路径 Unicode 控制字符 (#2334)
This commit is contained in:
parent
3548b4f1a5
commit
9ae3af4a7d
@ -4,6 +4,7 @@ import numpy as np
|
||||
import av
|
||||
from io import BytesIO
|
||||
import traceback
|
||||
import re
|
||||
|
||||
|
||||
def wav2(i, o, format):
|
||||
@ -55,4 +56,5 @@ def load_audio(file, sr):
|
||||
def clean_path(path_str):
|
||||
if platform.system() == "Windows":
|
||||
path_str = path_str.replace("/", "\\")
|
||||
path_str = re.sub(r'[\u202a\u202b\u202c\u202d\u202e]', '', path_str) # 移除 Unicode 控制字符
|
||||
return path_str.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
|
||||
|
Loading…
Reference in New Issue
Block a user