Python Librosa can';无法识别文件(.wav、.mp3)Pycharm MacOS

Python Librosa can';无法识别文件(.wav、.mp3)Pycharm MacOS,python,macos,file,pycharm,librosa,Python,Macos,File,Pycharm,Librosa,我想用Pycharm和librosa一起绘制某种类型音频文件的波形,但在加载文件时遇到了麻烦。当我开始运行它时,出现以下错误: /Users/username/Desktop/example/venv/lib/python3.7/site-packages/librosa/core/audio.py:162: UserWarning: PySoundFile failed. Trying audioread instead. warnings.warn("PySoundFile fai

我想用Pycharm和librosa一起绘制某种类型音频文件的波形,但在加载文件时遇到了麻烦。当我开始运行它时,出现以下错误:

/Users/username/Desktop/example/venv/lib/python3.7/site-packages/librosa/core/audio.py:162: UserWarning: PySoundFile failed. Trying audioread instead.
warnings.warn("PySoundFile failed. Trying audioread instead.")
    Traceback (most recent call last):
      File "/Users/username/example/venv/lib/python3.7/site-packages/librosa/core/audio.py", line 146, in load
        with sf.SoundFile(path) as sf_desc:
      File "/Users/username/Desktop/example/venv/lib/python3.7/site-packages/soundfile.py", line 629, in __init__
        self._file = self._open(file, mode_int, closefd)
      File "/Users/username/Desktop/example/venv/lib/python3.7/site-packages/soundfile.py", line 1184, in _open
        "Error opening {0!r}: ".format(self.name))
      File "/Users/username/Desktop/example/venv/lib/python3.7/site-packages/soundfile.py", line 1357, in _error_check
        raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
    RuntimeError: Error opening 'audiofile.filetype': System error.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/username/Desktop/example/main.py", line 6, in <module>
        y, sr = lr.load('audiofile.filetype', sr=None)
      File "/Users/username/Desktop/example/venv/lib/python3.7/site-packages/librosa/core/audio.py", line 163, in load
        y, sr_native = __audioread_load(path, offset, duration, dtype)
      File "/Users/username/Desktop/example/venv/lib/python3.7/site-packages/librosa/core/audio.py", line 187, in __audioread_load
        with audioread.audio_open(path) as input_file:
      File "/Users/username/Desktop/example/venv/lib/python3.7/site-packages/audioread/__init__.py", line 111, in audio_open
        return BackendClass(path)
      File "/Users/username/Desktop/example/venv/lib/python3.7/site-packages/audioread/rawread.py", line 62, in __init__
        self._fh = open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '2 octaves.mp3'
    
    Process finished with exit code 1
我试着将return
subprocess.Popen(cmd,*args,**kwargs,shell)
替换为
return subprocess.Popen(cmd,*args,**kwargs,shell=True)
in
ffdec.py
inaudioread

如果你知道如何解决这个问题,请帮助我和评论下面,谢谢

import librosa as lr
import librosa.display as ld
import matplotlib.pyplot as plt

# load mp3 doc
y, sr = lr.load('2 octaves.mp3', sr=None)

# plot a mp3form
plt.figure()
ld.waveplot(y, sr)
plt.title('Beat mp3form')
plt.show()