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
42
votes
10 answers

'GLIBCXX_3.4.30' not found for librosa in conda virtual environment (after trying out a lot of solutions)?

I am trying to import librosa, but I am thrown with this error: /home/lakshya/anaconda3/envs/tff_env/lib/python3.9/site-packages/zmq/backend/cython/../../../../.././libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by…
ChaoS Adm
  • 715
  • 1
  • 5
  • 12
38
votes
2 answers

How can I remove distortion introduced by librosa griffin lim?

I'm doing: import librosa D = librosa.stft(samples, n_fft=nperseg, hop_length=overlap, win_length=nperseg, window=scipy.signal.windows.hamming) spect, _ = librosa.magphase(D) audio_signal =…
Shamoon
  • 41,293
  • 91
  • 306
  • 570
25
votes
6 answers

librosa.display.waveplot(np.array(f),sr=22050)-----AttributeError: 'module' object has no attribute 'display'

Referring to this link: https://aqibsaeed.github.io/2016-09-03-urban-sound-classification-part-1/, I am trying to make the same waveplot figure, however,i run the code through .py, there is the error: (tensorflow) yyydeMacBook-Pro:~ yyy$ python…
Yiin
  • 251
  • 1
  • 3
  • 3
24
votes
2 answers

AttributeError: module 'librosa' has no attribute 'output'

I am using librosa 0.6 in anaconda and i have also installed ffmpeg but i am still getting this error the code is a = np.exp(spectrum) - 1 p = 2 * np.pi * np.random.random_sample(spectrum.shape) - np.pi for i in range(50): S = a *…
Aditya Kumar
  • 379
  • 1
  • 2
  • 7
22
votes
3 answers

Difference between mel-spectrogram and an MFCC

I'm using the librosa library to convert music segments into mel-spectrograms to use as inputs for my neural network, as shown in the docs here. How is this different from MFCCs, if at all? Are there any advantages or disadvantages to using either?
monadoboi
  • 1,651
  • 3
  • 16
  • 26
18
votes
3 answers

Librosa pitch tracking - STFT

I am using this algorithm to detect the pitch of this audio file. As you can hear, it is an E2 note played on a guitar with a bit of noise in the background. I generated this spectrogram using STFT: And I am using the algorithm linked above like…
pavlos163
  • 2,730
  • 4
  • 38
  • 82
15
votes
3 answers

pip's dependency resolver takes way too long to solve the conflict

I've been trying to install a package through pip on my rpi 3 model B my operating system is raspbian. Debian based pip version is 21.0.1 and python version is 3.7.4 the command I'm using is: python3 -m pip install librosa the problem is that the…
אופק כהן
  • 171
  • 1
  • 1
  • 5
14
votes
2 answers

RuntimeError at / cannot cache function '__shear_dense': no locator available for file '/home/...site-packages/librosa/util/utils.py'

I am trying to host django application with apache2. But getting the following error. RuntimeError at / cannot cache function '__shear_dense': no locator available for file…
Akash Pushkar
  • 313
  • 2
  • 9
14
votes
1 answer

How can I save a Librosa spectrogram plot as a specific sized image?

So I'm wanting to feed spectrogram images to a convolutional neural network as an attempt to classify various sounds. I want each image to be exactly 384x128 pixels. However, when I actually save the image it is only 297x98. Here's my code: def…
Sam McC
  • 261
  • 1
  • 3
  • 7
12
votes
1 answer

Convert PCM wave data to numpy arrays and vice versa

The situation I am using VAD (Voice Activity Detection) from WebRTC by using WebRTC-VAD, a Python adapter. The example implementation from the GitHub repo uses Python's wave module to read PCM data from files. Note that according to the comments the…
tiefenauer
  • 669
  • 7
  • 19
12
votes
4 answers

Difference between load of librosa and read of scipy.io.wavfile

I have a question about the difference between the load function of librosa and the read function of scipy.io.wavfile. from scipy.io import wavfile import librosa fs, data = wavfile.read(name) data, fs = librosa.load(name) The imported voice file…
이응재
  • 123
  • 1
  • 6
11
votes
1 answer

Python Librosa with Microphone input

So I am trying to get librosa to work with a microphone input instead of just a wav file and have been running to a few problems. Initially I use the pyaudio library to connect to the microphone but I am having trouble translating this data for…
Vince
  • 119
  • 2
  • 8
10
votes
1 answer

Plot the timeframe of each unique sound loop in a song, with rows sorted by sound similarity using python Librosa

Background Here's a video of a song clip from an electronic song. At the beginning of the video, the song plays at full speed. When you slow down the song you can hear all the unique sounds that the song uses. Some of these sounds repeat. Mp3, Wav…
Sam
  • 1,765
  • 11
  • 82
  • 176
10
votes
5 answers

Sort sounds by similarity based on timbre(tone)

Explanation I want to be able to sort a collection of sounds in a list based on the timbre(tone) of the sound. Here is a toy example where I manually sorted the spectrograms for 12 sound files that I created and uploaded to this repo. I know that…
Sam
  • 1,765
  • 11
  • 82
  • 176
10
votes
4 answers

Import librosa gives "no module named numba.decorators", how to solve?

I installed librosa, and now im trying to import it import librosa This throws me this error for some reason Traceback (most recent call last): File "", line 1, in File "C:\Users\Asish…
Asish Nayak
  • 101
  • 1
  • 1
  • 4
1
2 3
49 50