From 9ae3af4a7d9dc9acf4f6f46091927d664a3a7c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=B8=E5=B7=BE?= <66392653@qq.com> Date: Sat, 23 Nov 2024 20:46:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E9=9F=B3=E9=A2=91=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=B7=AF=E5=BE=84=20Unicode=20=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=20(#2334)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infer/lib/audio.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/infer/lib/audio.py b/infer/lib/audio.py index 8c688a0..60ef07c 100644 --- a/infer/lib/audio.py +++ b/infer/lib/audio.py @@ -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(" ")