Questions tagged [librosa]

librosa is a python package for music and audio analysis.

Following are some of the features of librosa

  • Load audio input
  • Compute mel-spectrogram, MFCC, delta features, chroma
  • Invert mel-spectrogram, MFCC or chroma back to waveform
  • Locate beat events
  • Compute beat-synchronous features
  • Display features
  • Save beat tracker output to a CSV file

For detailed information and examples, visit the librosa documentation.

See also the official Github page.

750 questions
1
vote
1 answer

What is returning after executing command to extract mfcc?

I have been learning Sound Analysis and i have encountered term mfcc in it. So when i execute librosa.feature.mfcc(y=X, sr=sample_rate, n_mfcc=40) I get numpy array of shape 40 by 216. So i get that I have extracted 40 features over 216…
Pratik
  • 51
  • 1
  • 6
1
vote
2 answers

Wav audio level is too large

I have a mono wav file for a 'glass breaking' sound. When I graphically display it's levels in python using librosa library, it shows very large range of amplitudes, between +/ 20000 instead of +/- 1. When I open same wav file with Audacity, the…
crbl
  • 379
  • 2
  • 13
1
vote
1 answer

Why does librosa STFT show wrong frequencies?

I generated a 200 Hz sine wave using numpy and then used librosas stft() and specshow() functions to show a spectrogram. However, the frequency it is showing is not 200 Hz. When I use matplotlibs magnitude_spectrum() function, it shows exactly 200…
1
vote
1 answer

Python librosa NoBackendError even though ffmpeg is installed

I recently installed librosa (package I've been using for a while on different PC) on my new PC with Windows 10 running. After that I've downloaded latest static version of ffmpeg and copied it to C: and added it to the Path. Tested ffmpeg and it…
slavko
  • 103
  • 1
  • 10
1
vote
2 answers

FileNotFoundError in Jupyter Notebook, even though the file is there

This was all written in Jupyter Notebook online. What supposed to happen, is the first line of the code is a command that converts some file in the folder labeled "capstone" into an mp4. This works fine, however the problem I'm running into is a…
Lofton Gentry
  • 189
  • 1
  • 13
1
vote
0 answers

Python: convert np.ndarray of float32 to sequence of bytes

I have an array of floats that is output by the librosa library load function that I would like to convert to an AudioData needed by google SpeechRecognition library The data formats are shown below Side note: these are read from comments in…
Mich
  • 3,188
  • 4
  • 37
  • 85
1
vote
2 answers

Nested For loop in python which starts second loop at the iterator of the first loop

I need to make the second python loop start following where the iterator of the first loop is at the entry into the second loop Currently both loops run the entire range Unfortunately I don't understand this syntax Full code in the example is here:…
Mich
  • 3,188
  • 4
  • 37
  • 85
1
vote
0 answers

Unable to open audio file on Heroku using Librosa

I have a feature extraction REST API written in Python using the Librosa library (Extracting audio features), it receives an audio file through HTTP POST and responds with a list of features(such as MFCC,etc). Since librosa depends on SoundFile…
Rohan Bojja
  • 655
  • 1
  • 16
  • 35
1
vote
0 answers

Cutting .wav file into segments with the same length

i want to cut an .wav file into multiple segments with the same length. I found this code: https://gist.github.com/kylemcdonald/c8e62ef8cb9515d64df4 But its splitted into parts based on onset detection with librosa. I assume that the answer to my…
sre
  • 31
  • 5
1
vote
0 answers

How can I match an audio clip inside an audio clip with Python?

I'm trying to detect with a short, mp3 jingle plays inside of a larger mp3 audio clip using Librosa. However, I'm having difficulty getting it to work, and I have no idea where to go next. This is the code that I have so far based off of this…
1
vote
1 answer

Is it possible to Integrate a python module in Xcode with my coreML model?

I have trained my Keras model and converted it into a coreML model. I have also developed an iPhone app using Swift. Now I want to extract features from the input audio files using librosa library and pass those features to the trained model to get…
Anjana K
  • 21
  • 5
1
vote
0 answers

The last dimension of the extracted Mel spectrum is 4

I am new to speech recognition. I plan to extract the Mel spectrum of the audio data, but I print out img.shape and find that its dimension is (650, 20000, 4), and the last dimension is 4, I don’t know why. Below is my code function. def…
赵若琰
  • 11
  • 2
1
vote
2 answers

can't import librosa lib on windows - "sndfile not found"

In jupyter on windows: import librosa /anaconda3/envs/python3/lib/python3.6/site-packages/soundfile.py in () 140 _libname = _find_library('sndfile') 141 if _libname is None: --> 142 raise OSError('sndfile library not…
ERJAN
  • 23,696
  • 23
  • 72
  • 146
1
vote
0 answers

How can i find the energy of custom list of frames in librosa?

i am trying to find the energy of list of frames. And I want to classify them into four criteria. For example "weak, normal, strong, too strong" and make a mixed array like normal_frames_array = [ 6, 34, 52, 71, 88, 107, 125, 143, 161, 198,…
Zekeriya Akgül
  • 308
  • 4
  • 14
1
vote
1 answer

Issue on import librosa command on Jupyter Notebook

I have installed Librosa using this command "pip install librosa" and it is successfully installed . But when I execute "import librosa" in Jupyter Notebook it gives error. Can anyone help ?
Wasim
  • 600
  • 2
  • 11
  • 32