无法让 librosa 加载 wav 文件

Can't get librosa load a wav file

我有一个包含许多 wav 文件的音频数据集,并且厌倦了使用 librosa 进行编辑,但是我无法使用 librosa.load.Could 读取某些文件,有人能帮我解决吗?

这是我的代码:

import librosa
sound_clip = librosa.load('audio/fold1/180937-7-3-10.wav')
print(sound_clip)

这里是错误:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-93fe2f032e98> in <module>()
----> 1 sound_clip = librosa.load('audio/fold1/180937-7-3-10.wav')
      2 print(sound_clip)

/home/uri7910/anaconda2/envs/tensorflow011/lib/python2.7/site-packages/librosa/core/audio.pyc in load(path, sr, mono, offset, duration, dtype)
    107 
    108     y = []
--> 109     with audioread.audio_open(os.path.realpath(path)) as input_file:
    110         sr_native = input_file.samplerate
    111         n_channels = input_file.channels

/home/uri7910/anaconda2/envs/tensorflow011/lib/python2.7/site-packages/audioread/__init__.pyc in audio_open(path)
    100         from . import maddec
    101         try:
--> 102             return maddec.MadAudioFile(path)
    103         except DecodeError:
    104             pass

/home/uri7910/anaconda2/envs/tensorflow011/lib/python2.7/site-packages/audioread/maddec.pyc in __init__(self, filename)
     24     def __init__(self, filename):
     25         self.fp = open(filename, 'rb')
---> 26         self.mf = mad.MadFile(self.fp)
     27         if not self.mf.total_time(): # Indicates a failed open.
     28             raise UnsupportedError()

AttributeError: 'module' object has no attribute 'MadFile'

失败的行是:

self.mf = mad.MadFile(self.fp)

AttributeError: 'module' object has no attribute 'MadFile'

这看起来是 pyMad library. Would suggest looking into upgrading or reinstalling. that library. If that fails you might want to raise a bug 的问题。