我正在比较 wav 文件,这个脚本运行良好,直到我切换到 LMDE Betsy。给我错误的功能是:
def already_valid (arg_wav):
for w in wavs:
size_arg = getsize(arg_wav.src_path)
size_w = getsize(w.src_path)
if 0 < size_w == size_arg and w.src_path != arg_wav.src_path:
print arg_wav.src_path, "::", w.src_path
if audiodiff.audio_equal(arg_wav.src_path, w.src_path):
return True
return False
我的第一个想法是它试图两次打开同一个文件,但w.src_path != arg_wav.src_path
应该考虑到这一点。我得到这个输出:
从我的功能:
/home/will/Desktop/soundfiles/TITAN Recordings/6648/hold1_por.wav :: /home/will/Desktop/soundfiles/TITAN Recordings/6677/hold1_por.wav
追溯:
Traceback (most recent call last):
File "call_diff.py", line 145, in <module>
verified += handle_wav(p)
File "call_diff.py", line 73, in handle_wav
if already_valid(curr_wav):
File "call_diff.py", line 96, in already_valid
if audiodiff.audio_equal(arg_wav.src_path, w.src_path):
File "/usr/local/lib/python2.7/dist-packages/audiodiff/__init__.py", line 51, in audio_equal
return checksum(name1, ffmpeg_bin) == checksum(name2, ffmpeg_bin)
File "/usr/local/lib/python2.7/dist-packages/audiodiff/__init__.py", line 86, in checksum
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
奇怪的是它昨天在 Linux Mint 17.1和Windows 7 上运行。这是我不知道的一些奇怪的 Debian 约定吗?是的,我仔细检查了两个文件都存在于所描述的路径中。