移除音频文件路径 Unicode 控制字符 (#2334)
This commit is contained in:
parent
3548b4f1a5
commit
9ae3af4a7d
@ -4,6 +4,7 @@ import numpy as np
|
|||||||
import av
|
import av
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
import traceback
|
import traceback
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
def wav2(i, o, format):
|
def wav2(i, o, format):
|
||||||
@ -55,4 +56,5 @@ def load_audio(file, sr):
|
|||||||
def clean_path(path_str):
|
def clean_path(path_str):
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
path_str = path_str.replace("/", "\\")
|
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(" ")
|
return path_str.strip(" ").strip('"').strip("\n").strip('"').strip(" ")
|
||||||
|
Loading…
Reference in New Issue
Block a user