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
2
votes
1 answer

MFCC feature extraction, Librosa

I want to extract mfcc features of an audio file sampled at 8000 Hz with the frame size of 20 ms and of 10 ms overlap. What must be the parameters for librosa.feature.mfcc() function. Does the code written below specify 20ms chunks with 10ms…
2
votes
0 answers

What method does Librosa use to calculate Delta-MFCC?

I am trying to generate the delta-MFCCs. Apparently there are several implementations. I found the "regression" formula link here. But I don't understand why Librosa uses Savitsky-Golay filter, which is a smoothing filter. I have not found any…
Satashree Roy
  • 365
  • 2
  • 9
2
votes
1 answer

Implementing STFT with Pytorch gives a slightly different result than the STFT with Librose

I am trying to implement STFT with Pytorch. But the output from the Pytorch implementation is slightly off, when compared with the implementation from Librosa. Librosa version import numpy as np from librosa.core import stft import matplotlib.pyplot…
Raven Cheuk
  • 2,903
  • 4
  • 27
  • 54
2
votes
1 answer

How to convert a wav file into RGB image with melspectogram?

I am working on sound classification with wav files ranging from 1 second to 4 second. i want to convert wav to 224x224x3 image that i can fee into Resnet for classification The conversion should be using melspectogram Thanks for help
2
votes
1 answer

How to read audio in python using Librosa?

I am trying to read an audio file in Librosa but getting the following error FileNotFoundError: [WinError 2] The system cannot find the file specified It is mentioned that somewhere I need to install ffmpeg but it did not solve the problem. I have…
Samual
  • 512
  • 6
  • 19
2
votes
2 answers

How to plot spectrum or frequency vs amplitude of entire audio file using python?

I have some audio files, I want to plot the average spectrum of the audio files like "audacity" software using PYTHON (librosa library). I can see they are plotting average frequency vs amplitude plot of the entire audio. After that, I want to…
taserghar
  • 340
  • 3
  • 15
2
votes
1 answer

normalizing mel spectrogram to unit peak amplitude?

I am new to both python and librosa. I am trying to follow this method for a speech recognizer: acoustic front end My code: import librosa import librosa.display import numpy as np y, sr = librosa.load('test.wav', sr = None) normalizedy =…
sabri
  • 23
  • 1
  • 8
2
votes
0 answers

NoBackendError with Audioread

I'm trying to use librosa.load() to load a midi file, but I'm getting a NoBackendError. In my conda environment I have installed ffmpeg 4.1 from conda forge, but it still gives me the error. I'm using jupyter lab, if that's relevent. Thanks
Andrew
  • 31
  • 3
2
votes
1 answer

Swift + Python: No module named librosa or pyaudio

I am performing a simple test to load Python libraries in a Swift app (below is the code). All the Python libraries load OK except librosa and pyaudio (yes I have them installed via pip and yes they work in native Python). When I run the app I get…
David Cittadini
  • 369
  • 3
  • 15
2
votes
1 answer

How to read audio file from google cloud storage bucket and play with ipd in a datalab notebook

I want to play a sound file in a datalab notebook which I read from a google cloud storage bucket. How to do this?
2
votes
1 answer

Parameters to control the size of a spectrogram

I am trying to get the spectrogram as described by the following instruction. Each audio segment has duration of 5s. Frames with equal size are extracted from the audio (with overlap between the consecutive frames), and each of the frame…
Raven Cheuk
  • 2,903
  • 4
  • 27
  • 54
2
votes
2 answers

Machine Learning - any suggestions to solve Python rounding errors?

I am working with Python to isolate elements from music. Training a model, I break my audio into frames, and have a label for each frame - 1 or 0. Unfortunately, due to rounding errors, my labels are always 1 or 2 frames short. Converting my audio…
user8716125
2
votes
1 answer

generate mfcc's for audio segments based on annotated file

My main goal is in feeding mfcc features to an ANN. However I am stuck at the data pre processing step and my question has two parts. BACKGROUND : I have an audio. I have a txt file that has the annotation and time stamp like this: 0.0 2.5…
kRazzy R
  • 1,561
  • 1
  • 16
  • 44
2
votes
0 answers

Generating a Midi (or chart preferably) file from mp3 onsets

I am using librosa's onset function to generate onsets for an mp3. Is there away I can turn this in to Midi format?
mabel
  • 173
  • 12
2
votes
2 answers

audio buffer with librosa

In the following code I created a buffer which holds 10 frames of an audio file in each loop iteration. import collections import librosa import wave my_buffer = collections.deque(maxlen=10) f = wave.open('Desktop/0963.wav',"rb") num_frames =…
Emanuela Liaci
  • 165
  • 1
  • 12