1

I am getting the following error while executing the mentioned code. This is the first time I am using StackOverflow so pardon my mistakes.

---------------------------------------------------------------------------
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: 
  • How did you install librosa? I suggest using (mini)conda, i.e. a virtual environment. See https://stackoverflow.com/a/56252379/942774 – Hendrik Jul 05 '19 at 06:30
  • I installed librosa using "pip install librosa". After that, I imported librosa in a jupyter notebook (through anaconda) using "import librosa". Mentioned error occurred when ran the cell after giving the path to a music track that I want to analyze. – Abhishek Duhan Jul 14 '19 at 04:33
  • I recommend installing librosa using conda through the conda-forge channel to get all dependencies correctly. – Hendrik Jul 14 '19 at 06:25

2 Answers2

1

On Ubuntu,you can solve the problem by installing libav-toools or ffmpeg:

sudo apt-get install libav-tools

Or

sudo apt-get install -y ffmpeg

See here.

Tshilidzi Mudau
  • 7,373
  • 6
  • 36
  • 49
0

I'm facing the same error too. For importing the audio files, you can use:

import scipy.io as sio

samplerate, data = sio.wavfile.read(location_of_file)
Ardent Coder
  • 3,777
  • 9
  • 27
  • 53