在执行上述代码时出现以下错误。这是我第一次使用StackOverflow,请原谅我的错误。
---------------------------------------------------------------------------
NoBackendError Traceback (most recent call last)
<ipython-input-29-2eac49b48cf3> in <module>
1
2 audio_path = 'C:/Users/Abhishek Duhan/Desktop/EP.mp3'
----> 3 y, sr = librosa.load(audio_path)
~\Anaconda3\lib\site-packages\librosa\core\audio.py in load(path, sr, mono, offset, duration, dtype, res_type)
117
118 y = []
--> 119 with audioread.audio_open(os.path.realpath(path)) as input_file:
120 sr_native = input_file.samplerate
121 n_channels = input_file.channels
~\Anaconda3\lib\site-packages\audioread\__init__.py in audio_open(path)
114
115 # All backends failed!
--> 116 raise NoBackendError()
NoBackendError:
答案 0 :(得分:0)
我也面临着同样的错误。要导入音频文件,可以使用:
import scipy.io as sio
samplerate, data = sio.wavfile.read(location_of_file)
答案 1 :(得分:0)
在Ubuntu上,您可以通过安装libav-toools或ffmpeg来解决该问题:
sudo apt-get install libav-tools
或
sudo apt-get install -y ffmpeg
请参见here。