当我尝试使用与模块 librosa 相关的任何内容时,出现错误:
Traceback (most recent call last):
File "C:\Users\User1\Documents\test3.py", line 36, in <module>
x, Fs = librosa.load(fn_mp3, sr=None)
File "C:\Program Files\Python38\lib\site-packages\librosa\core\audio.py", line 129, in load
with sf.SoundFile(path) as sf_desc:
File "C:\Program Files\Python38\lib\site-packages\soundfile.py", line 629, in __init__
self._file = self._open(file, mode_int, closefd)
File "C:\Program Files\Python38\lib\site-packages\soundfile.py", line 1172, in _open
openfunction = _snd.sf_wchar_open
AttributeError: cffi library 'C:\Program Files\Python38\lib\site-packages\_soundfile_data\libsndfile64bit.dll' has no function, constant or global variable named 'sf_wchar_open'
在我遇到一些错误之前,我libsndfile64bit.dll
在站点包中创建了一个名为_soundfile_datalibsndfile64bit.dll
的文件夹并从这里下载,然后将其添加到该文件夹中,然后弹出我提供的错误。我曾尝试在 SO 上搜索答案,但没有相关问题,我无法编辑,libsndfile64bit.dll
因此我无能为力。我在 Windows OS 64x、Python 3.8 和 librosa 0.7.2 上。