我正在克隆this repo。我安装了ffmpeg-normalize,并且pip install ffmpeg-normalize
返回
已经满足要求...
但是在执行preprocess.py步骤时,我得到了一个ffmpeg-normalize不存在的错误:
违规代码:
def preprocess(audio_filename, output_filename):
ext_ind = audio_filename.rfind('.wav')
audio_filename_formatted = audio_filename[:ext_ind] + '-formatted.wav'
try:
os.remove(audio_filename_formatted)
except OSError:
pass
try:
os.remove(output_filename)
except OSError:
pass
error = os.system(
'ffmpeg -i {} -acodec pcm_s16le -ac 1 -ar 16000 {}'.format(
audio_filename, audio_filename_formatted))
if error:
print error
raise StandardError('ffmpeg or audio file doesn\'t exist')
error = os.system(
'ffmpeg-normalize -f {}'.format(audio_filename_formatted))
if error:
raise StandardError('ffmpeg-normalize doesn\'t exist')
data = wavfile.read(audio_filename_formatted)
mfcc_inst = MFCC()
features = mfcc_inst.sig2s2mfc_energy(data[1])
np.save(output_filename, features)
if __name__ == '__main__':
if len(sys.argv) < 3:
sys.exit(
"Have to pass audio_filename and output_filename as parameters.")
print sys.argv[1],sys.argv[2]
preprocess(sys.argv[1], sys.argv[2])
安装所需的步骤后还有其他步骤吗?在Mac上运行是否有问题?我在这里完全迷路了。预先谢谢你。