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

MFCC Python: completely different result from librosa vs python_speech_features vs tensorflow.signal

I'm trying to do extract MFCC features from audio (.wav file) and I have tried python_speech_features and librosa but they are giving completely different results: audio, sr = librosa.load(file, sr=None) # librosa hop_length = int(sr/100) n_fft =…
TYZ
  • 8,466
  • 5
  • 29
  • 60
10
votes
3 answers

Cannot install librosa python, how can I uninstall llvmlite?

I have recently tried to install librosa on Windows using pip install librosa. Nevertheless, this error appears: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot accurately determine which files belong to it…
Josemi
  • 314
  • 1
  • 4
  • 20
10
votes
1 answer

Calculating spectrogram of .wav files in python

I am trying to calculate the spectrogram out of .wav files using Python. In an effort to do so, I am following the instructions that could be found in here. I am firstly read .wav files using librosa library. The code found in the link works…
Jose Ramon
  • 5,572
  • 25
  • 76
  • 152
10
votes
2 answers

Recorded audio of one note produces multiple onset times

I am using the Librosa library for pitch and onset detection. Specifically, I am using onset_detect and piptrack. This is my code: def detect_pitch(y, sr, onset_offset=5, fmin=75, fmax=1400): y = highpass_filter(y, sr) onset_frames =…
pavlos163
  • 2,730
  • 4
  • 38
  • 82
9
votes
4 answers

How to solve the pytorch RuntimeError: Numpy is not available without upgrading numpy to the latest version because of other dependencies

I am running a simple CNN using Pytorch for some audio classification on my Raspberry Pi 4 on Python 3.9.2 (64-bit). For the audio manipulation needed I am using librosa. librosa depends on the numba package which is only compatible with numpy…
Odin
  • 156
  • 1
  • 1
  • 7
9
votes
1 answer

librosa.load() takes too long to load(sample) mp3 files

I am trying to sample (convert analog to digital) mp3 files via the following Python code using the librosa library, but it takes too much time (around 4 seconds for one file). I suspect this is because librosa doesn't support mp3 and hence uses…
john doe
  • 437
  • 2
  • 5
  • 13
8
votes
6 answers

audioread.exceptions.NoBackendError in librosa

import librosa import librosa.display import IPython.display import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.font_manager as fm audio_path = 'rec.wav' y, sr = librosa.load(audio_path) I tried to load…
kimhanuu
  • 165
  • 1
  • 1
  • 11
8
votes
4 answers

Find sound effect inside an audio file

I have a load of 3 hour MP3 files, and every ~15 minutes a distinct 1 second sound effect is played, which signals the beginning of a new chapter. Is it possible to identify each time this sound effect is played, so I can note the time offsets? The…
Craig Francis
  • 1,855
  • 3
  • 22
  • 35
8
votes
2 answers

Store the Spectrogram as Image in Python

I want to store the STFT spectrogram of the audio as image. The code below shows a spectrogram to me as output, but when saved as image I get a different image. import numpy as np import matplotlib.pyplot as plt import pandas as pd audio_name =…
Becky
  • 191
  • 1
  • 1
  • 10
8
votes
1 answer

Which tool can I trust?

I seem to have to problems determining which tool I can trust... The tools i've been testing is Librosa and Kaldi in creating dataset for plots visualizations of 40 filterbank energies of an audio file. The filterbank energies are extracted using…
I am not Fat
  • 283
  • 11
  • 36
8
votes
2 answers

Sampling rate issue with Librosa

When doing a STFT, and then an inverse STFT (iSTFT) on a 16 bits 44.1 khz audio file with the library Librosa : import librosa y, sr = librosa.load('test.wav', mono=False) y1 = y[0,] S = librosa.core.stft(y1) z1 = librosa.core.istft(S,…
Basj
  • 41,386
  • 99
  • 383
  • 673
7
votes
3 answers

What does librosa.load return?

I'm working with the librosa library, and I would like to know what information is returned by the librosa.load function when I read a audio (.wav) file. Is it the instantaneous sound pressure in pa, or the just the instantaneous amplitude of the…
thileepan
  • 619
  • 3
  • 8
  • 18
7
votes
1 answer

I think Librosa.effect.split has some problem?

firstly, this function is to remove silence of an audio. here is the official description: https://librosa.github.io/librosa/generated/librosa.effects.split.html librosa.effects.split(y, top_db=10, *kargs) Split an audio signal into non-silent…
BarCodeReader
  • 327
  • 2
  • 12
7
votes
1 answer

Tensorflow error "has type list, but expected one of: int, long, float"

I was going to do something with tensorflow and librosa, but when I used TFRecore, there was an error. I didn't find the answer after google, so I want to consult you here. def create_record(): writer =…
tuffy chow
  • 117
  • 1
  • 7
7
votes
1 answer

Load FLAC file in python same as scipy or librosa

I would like to feed some flac sound files into a keras model. With wavfiles I can do (contrived example with one audio file used twice) import scipy.io.wavfile import numpy as np import keras from keras.models import Sequential from keras.layers…
Harry Moreno
  • 10,231
  • 7
  • 64
  • 116
1
2
3
49 50