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

How extract numpy array features from spectrogram?

I created a spectrogram with this code: D = librosa.amplitude_to_db(librosa.stft(y), ref=np.max) librosa.display.specshow(D, y_axis='linear', x_axis='time') plt.colorbar(format='%+2.0f dB') plt.title('Log-frequency power…
Timebird
  • 149
  • 2
  • 4
  • 12
2
votes
1 answer

Compute MFCC using Librosa

I am trying to use the librosa library to compute the MFCC of my time series. The time series is directly from data collected from a device at a sampling rate of 50 Hz. Could someone help clarify on what values I could use for n_fft, hop_length,…
DSPNewbie
  • 33
  • 5
2
votes
1 answer

How can I extract CQT from audio with sampling rate 8000Hz (librosa)

How can I extract CQT from audio with sampling rate 8000 Hz (librosa) I wrote following codes. sound_clip, s = librosa.load(fn, sr=8000) cqtpec = librosa.cqt(y=sound_clip, sr=s) But there was an error. librosa.util.exceptions.ParameterError:…
HS Cho
  • 91
  • 1
  • 2
  • 4
2
votes
1 answer

Error creating graphics ctxt object in python librosa

I am trying to plot some .wav data with librosa, but I am having some unusual problems that I couldn't find much on googling "python librosa error creating graphics ctxt object" def plot_waves(sound_names, raw_sounds): i = 1 fig =…
SwimBikeRun
  • 4,192
  • 11
  • 49
  • 85
2
votes
1 answer

"Segmentation Fault" in matplotlib running example Librosa script

After many issues I've installed Librosa (https://github.com/librosa/librosa) on Linux Mint 18 Mate x64. When I want to run example script, e.g.: http://librosa.github.io/librosa/generated/librosa.feature.tempogram.html#librosa.feature.tempogram, it…
dawlib
  • 237
  • 2
  • 13
1
vote
0 answers

How train a CNN using stft matrix as inputs

I try to train an autoencoder using stft as inputs (stft without passing by spectrogramms) and I'm new in audio processing and deep learning so I find some difficult in how I can preprocessing my inputs to be ready for our model import…
1
vote
3 answers

Getting a ModuleNotFoundError with librosa

I am trying to load the audio files into the NumPy array using this code #%% import librosa import matplotlib.pyplot as plt import IPython.display as ipd import os, os.path import time import joblib import numpy as np #%% fname =…
1
vote
1 answer

Understanding mel-scaled spectrogram for a simple sine wave

I generate a simple sine wave with a frequency of 100 and calculate an FFT to check that the obtained frequency is correct. Then I calculate melspectrogram but do not understand what its output means? where do I see the frequency 100 in this output?…
codeDom
  • 1,623
  • 18
  • 54
1
vote
0 answers

Encounter error while using 'kaiser_fast' in librosa.load

I want to load *.wav files. I am using the following code audio, sample_rate = librosa.load(file_name, res_type='kaiser_fast', duration=20) However, I get the following error No module named 'resampy' I tried to install resampy and it…
1
vote
0 answers

Pre-processing audio with different durarion for BiLSTM model

due to a lack of understanding of how audio works, I have a question. What is meant in the text below? Is it required that the length of each audio is divisible by 5 without a remainder, or what? Step 2: Transfer Spectrogram to Array: each row in…
Dan
  • 11
  • 2
1
vote
1 answer

Python, working with sound: librosa and pyrubberband conflict

I have the following script that I was using to manipulate an mp3: import librosa import soundfile as sf from playsound import playsound from direct.showbase.ShowBase import ShowBase #import pyrubberband as pyrb filename = "music.mp3" y, sr =…
Charmalade
  • 645
  • 1
  • 6
  • 14
1
vote
0 answers

Hey guys, i'm trying to make a karaoke scoring system based on pitch and rhythm

import librosa import numpy as np #load the karaoke audio file y, sr = librosa.load('karaoke_performance.wav') #pitch contour arr = librosa.core.pitch.yin(y,fmin=librosa.note_to_hz('C2'),fmax=librosa.note_to_hz("C7"),sr=sr) #load reference audio…
1
vote
1 answer

Error when tying to execute the .exe generated by pyinstaller

I just finished a project and want to convert it to a executable. When using pyinstaller with the command pyinstaller --onefile Music_sorter_by_Fabrice_Schöneberger.py it compiles without an error. But when executing the file I get the following: …
1
vote
1 answer

librosa I am getting module

import numpy as np import librosa from scipy.io import wavfile from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPClassifier from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import…
1
vote
0 answers

Audio extracted using ffmpeg giving nan and very low/high (2.6283893e-37) values

I'm extracting raw audio from a .flac file(youtube link - https://youtu.be/--BfvyPmVMo , extracting 10sec from this) and storing it as np-array float32. Getting nan, and extremely low and high values = [-8.63468980e+30 -9.76911766e+34…
Shreya Gupta
  • 97
  • 2
  • 8