librosa.load: file not found error on loading a file

前端 未结 4 512
盖世英雄少女心
盖世英雄少女心 2021-01-28 09:17

I am trying to use librosa to analyze .wav files. I started with creating a list which stores the names of all the .wav files it detected.

data_dir = \'/Users/r         


        
相关标签:
4条回答
  • 2021-01-28 09:41

    Two things:

    1. It looks like you are using Homebrew
    2. avconv is not in your path

    Assuming, you have never installed it, you should be able to solve this simply by installing it. I.e. run:

    $ brew install libav
    

    (see here)

    If avconv is already installed, you probably need to look into your PATH environment and check whether it is in the path.

    That said, using a system-wide Python as installed by Homebrew is a bad idea, because it does not quickly let you change Python versions and dependency sets. It all becomes one big mess within weeks.

    One (among multiple) solutions for this is to use miniconda. It quickly lets you activate Python interpreters with defined dependency sets.

    So to really solve the issue, I'd recommend to install miniconda and create a plain Python 3.6 environment:

    $ conda create -n librosa_env python=3.6
    

    Activate the environment:

    $ source activate librosa_env
    

    Then add the conda-forge channel (a repository that contains many libraries like librosa):

    $ conda config --add channels conda-forge
    

    Then install librosa:

    $ conda install librosa
    

    By installing librosa this way, conda should take care of all dependencies, incl. libav.

    0 讨论(0)
  • 2021-01-28 09:44

    I had to install FFMPEG to solve the issue.. You may follow along the link https://www.wikihow.com/Install-FFmpeg-on-Windows for the same.

    0 讨论(0)
  • 2021-01-28 09:55

    Upgrading audioread to 2.1.8 fixed this issue for me. The bugfix can be inspected here: https://github.com/beetbox/audioread/commit/8c4e236fda38ce1d1f6dafc4715074a790e62849

    0 讨论(0)
  • 2021-01-28 09:56

    That error suggests librosa is unable to find FFMPEG executables, of which avconv is an example.

    When not converting different samplerates, FFMPEG is often not needed. You can try to specify the sample size to be the original of the audio file during load()

    0 讨论(0)
提交回复
热议问题