Skip to content

Commit 9e5f5ed

Browse files
authored
Update my_utils.py
1 parent c592a39 commit 9e5f5ed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

my_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def load_audio(file,sr):
55
# https://github.com/openai/whisper/blob/main/whisper/audio.py#L26
66
# This launches a subprocess to decode audio while down-mixing and resampling as necessary.
77
# Requires the ffmpeg CLI and `ffmpeg-python` package to be installed.
8+
file=file.strip(" ").strip('"').strip("\n").strip('"').strip(" ")#防止小白拷路径头尾带了空格和"和回车
89
out, _ = (
910
ffmpeg.input(file, threads=0)
1011
.output("-", format="s16le", acodec="pcm_s16le", ac=1, ar=sr)

0 commit comments

Comments
 (0)