Python - audiodiff无法找到存在的文件

时间:2015-06-16 21:56:44

标签: python debian filenotfoundexception linuxmint audio-fingerprinting

我正在比较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

在昨天的Windows Mint 17.1 上运行它是如此奇怪的是。这是一些我不知道的奇怪的Debian约定吗?是的,我仔细检查了两个文件存在于所描述的路径中。

1 个答案:

答案 0 :(得分:0)

如果查看audiodiff的源代码,您将看到需要安装 ffmpeg ,并且可能要将ffmpeg二进制文件的路径设置为FFMPEG_BIN环境变量。

https://github.com/clee704/audiodiff/blob/master/audiodiff/init.py