如何解决附加时Pydub中的异常
我正在尝试使用 Pydub 将一些 .webm 文件连接到 .mp3。
这是我已经实现的:
audio_files = [merging_directory_path+'/'+aud for aud in os.listdir(merging_directory_path) if aud.endswith(".webm")]
sounds = []
for songs in audio_files:
print(songs)
file.write("\nDebug : " +songs)
sounds.append(AudioSegment.from_file(songs))
playlist = AudioSegment.empty()
for sound in sounds:
playlist += sound
playlist.export("output.mp3",format="mp3")
这是回溯:
File "audiomerging.py",line 145,in ProcessImages
sounds.append(AudioSegment.from_file((songs))
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pydub\audio_segment.py",line 716,in from_file
p = subprocess.Popen(conversion_command,stdin=stdin_parameter,File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py",line 854,in __init__
self._execute_child(args,executable,preexec_fn,close_fds,line 1247,in _execute_child
args = list2cmdline(args)
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py",line 549,in list2cmdline
for arg in map(os.fsdecode,seq):
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\os.py",line 818,in fsdecode
filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str,bytes or os.PathLike object,not NoneType
这就是调试行打印的内容:
Debug : .Audio-a/Audio_15-11-201911-00-11.webm
我做错了什么吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。