Python - audiodiff 找不到存在的文件
Python - audiodiff can't find file that exists
我正在比较 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 约定吗我不知道知道关于?是的,我仔细检查并两个 文件都存在于所描述的路径中。
如果你查看 audiodiff 的源代码,你会发现你需要安装 ffmpeg 并且可能将 ffmpeg 二进制文件的路径设置为 FFMPEG_BIN 环境变量.
https://github.com/clee704/audiodiff/blob/master/audiodiff/init.py
我正在比较 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 约定吗我不知道知道关于?是的,我仔细检查并两个 文件都存在于所描述的路径中。
如果你查看 audiodiff 的源代码,你会发现你需要安装 ffmpeg 并且可能将 ffmpeg 二进制文件的路径设置为 FFMPEG_BIN 环境变量.
https://github.com/clee704/audiodiff/blob/master/audiodiff/init.py