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

librosa does not normalize wave file between [-1, 1]

In passing a file via the use: librosa_audio, librosa_sample_rate = librosa.load(filename) The output produces an audio file such that: Librosa audio file min~max range: -1.2105224 to 1.2942806 The file that I am working on was obtained from…
Joe
  • 357
  • 2
  • 10
  • 32
3
votes
1 answer

How to resample a .wav sound file which is being read using the wavfile.read?

I want to change the following two lines of my code: clip, sample_rate = librosa.load(file_name) clip = librosa.resample(clip, sample_rate, 2000) I want to load the .wav file using wavfile.read() instead of using librosa.load() and then resample it…
3
votes
1 answer

Add noise to Audio File and Reconvert the Noisy signal using Librosa Python

I am adding noise to a signal using librosa but after adding noise I am unable to save the signal back as wav file. My code is as follows: import librosa import matplotlib.pyplot as plt import numpy as np import math file_path =…
user13832229
3
votes
1 answer

Is there a way to add gain to an audio signal with Librosa in python?

I am currently working on augmenting audio in Python. I've been using Librosa due to its speed and simplicity but need to fallback on PyDub for some other utilities such as applying gain. Is there a mathematical way to add gain to the Numpy array…
Coldchain9
  • 1,373
  • 11
  • 31
3
votes
1 answer

Getting 96 MFCC features using python_speech_features

I want to train my model using 96 MFCC Features. I used Librosa and I didnt get a promising result. I then tried to use python_speech_features, however I can get no more than 26 features! why! This is the shape for the same audio file using…
sin0x1
  • 105
  • 1
  • 3
  • 13
3
votes
0 answers

Librosa STFT time bins do not begin at 0 seconds

In comparing the outputs of Scipy’s STFT and Librosa’s STFT, I found that the respective time bins in the 2D output arrays were off by one. To clarify, Scipy’s Zxx resulted in an output of (513, 341), and Librosa’s stft gave me (513, 340). I printed…
3
votes
1 answer

installing `libm.so.6` through Anaconda

I have a centOS machine that I do not have sudo access. I needed to use librosa python package so I have installed Anaconda and installed the package through conda. However, when I import this package I get ImportError: /lib64/libm.so.6: version…
Brandon Lee
  • 695
  • 1
  • 10
  • 22
3
votes
1 answer

How to split a single audio file into multiple files?

I want to split a single audio file into multiple audio files using python and save them, the peaks in file is separated by silence. The audio file contains 5 A's The waveform is given below: I have tried librosa library and pydub codes for the…
3
votes
1 answer

What is the warning 'Empty filters detected in mel frequency basis. ' about?

I'm trying to extract MFCC features from an audio file with 13 MFCCs with the below code: import librosa as l x, sr = l.load('/home/user/Data/Audio/Tracks/Dev/FS_P01_dev_001.wav', sr = 8000) n_fft = int(sr * 0.02) hop_length = n_fft // 2 mfccs…
3
votes
2 answers

"wave.Error: unknown format: 3" after using librosa.resample. Is there anything wrong with the output of librosa?

I have a .wav file with a sample rate of 44.1khz, I want to resample it into 16khz by using librosa.resample. Though the output.wav sounds great, and it is 16khz, but I got an error when I'm trying to read it by wave.open. and this problem is quite…
Range
  • 31
  • 1
  • 6
3
votes
1 answer

Librosa: Filter pass-band beyond Nyquist

Librosa Python 3.5 On 8000Hhz Audio samples getting error: extract feature error. Filter pass-band lies beyond Nyquist Was previously getting other errors about Nyquist, but fixed by setting sr and fmin manually, can't seem to get past this one…
CDMXSet
  • 41
  • 6
3
votes
2 answers

How to get GFCC instead of MFCC in python?

Today i'm using MFCC from librosa in python with the code below. It gives an array with dimension(40,40). import librosa sound_clip, s = librosa.load(filename.wav) mfcc=librosa.feature.mfcc(sound_clip, n_mfcc=40, n_mels=60) Is there a similiar…
gynther
  • 69
  • 1
  • 9
3
votes
1 answer

Getting spectrogram from recorded audio , ERROR: "ParameterError: Audio buffer is not finite everywhere"

I'm trying to record a sound using 'pyaudio' and get a spectrogram for the audio, but I get the above error: " Audio buffer is not finite everywhere". It might be a possible duplicate, but I didn't find something which solves the eroror. Here is my…
Ravi
  • 167
  • 2
  • 12
3
votes
1 answer

Multiprocessing Pool slow when calling external module

My script is calling librosa module to compute Mel-frequency cepstral coefficients (MFCCs) for short pieces of audio. After loading the audio, I'd like to compute these (along with some other audio features) as fast as possible - hence…
Lukasz Tracewski
  • 10,794
  • 3
  • 34
  • 53
3
votes
0 answers

Extracting features from audio signal

I have just started to work on data in the form of audio. I am using librosa as a tool. My project requires me to extract features like: Total duration of the audio Minimum Intensity of the audio signal Maximum Intensity of the audio signal Mean…
paradocslover
  • 2,932
  • 3
  • 18
  • 44