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
1
vote
0 answers

Is there any method to create a windows executable from python script besides pyinstaller?

I have to create an exe file from my python script. I use pyinstaller, but sometimes it does not create executables, e.g., when I use libraries like librosa or Keras. Is there some other way to create executables?
Anton
  • 55
  • 6
1
vote
1 answer

Librosa (Python) to Meyda (Node.js) conversion

I am converting a Python program to Node.js, the program follows these steps: Microphone listens with callbacks Callbacks do a Librosa "log_mel_S" extraction The "log_mel_S" is inferenced by an AI model Sound is labeled I have managed to translate…
belferink1996
  • 53
  • 1
  • 9
1
vote
0 answers

Extract audio segments of onsets using peak picking

I have a couple of .wav sound files with very similar percussive signals of ~60ms duration. I can identify their onset times using libROSA's onset detection quite well. I would now like to extract the associated audio segments of ~60ms from the…
VGF
  • 55
  • 8
1
vote
1 answer

AttributeError: module 'librosa.feature' has no attribute 'short_time_energy'

I want to extract short time energy from audio by using librosa, but I get AttributeError: module 'librosa.feature' has no attribute 'short_time_energy'. I need a solution for this problem. My code: fn_list_i = [ feature.short_time_energy ] …
sera
  • 63
  • 5
1
vote
2 answers

How do I find amplitude of wav file in python?

I am working with wav files analysis using the librosa library in python. I used librosa.load() to load the audio file. Apparently this function loads the wav file into a numpy array with normalised amplitude values in the range -1 to 1. But I need…
Archit Sahu
  • 13
  • 1
  • 4
1
vote
1 answer

ValueError: Input signal length=2 is too small to resample from 44100->16000

I am trying to read some audio wav files and everything was perfect until I added some more audio files I faced an error. The reading audio files and resampling it to 16KHz using the following code def speech_file_to_array_fn(batch): start = 0 …
Omar
  • 297
  • 5
  • 16
1
vote
0 answers

Librosa.resample() resamples to a lower rate than needed

I am doing some audio pre-processing to train a ML model. All the audio files of the dataset are: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz. I am using the following snippet of code to resample the dataset to 8000…
1
vote
1 answer

OSError when tried to load librosa (import soundfile error)

When I ran import librosa, I got the following error message: OSError: cannot load library 'C:\ProgramData\Anaconda3\Library\bin\sndfile.dll': error 0x7e and OSError: cannot load library…
alpha
  • 173
  • 1
  • 2
  • 12
1
vote
1 answer

ValueError: `sequences` must be a list of iterables. Found non-iterable: 0.0382184

I am extracting Mel spectrogram from the audio file then I want to apply padding y,sr = librosa.load(r"/content/test.WAV") mel = librosa.feature.melspectrogram(y=y, sr=sr) mel=np.mean(mel,…
Mohamed Amine
  • 340
  • 1
  • 4
  • 16
1
vote
1 answer

log mel spectrogram using librosa

I have come across 2 different ways of generating log-mel spectrograms for audio files using librosa and I don't know why they differ in the final output, which one is "correct" or how different is one from the other. #1 path =…
VITTHAL BHANDARI
  • 139
  • 2
  • 5
  • 15
1
vote
0 answers

Power spectrum using librosa python

I need to obtain an FFT spectrum and Power spectrum in dB for a .wav file with 2s of data. I need to obtain an "averaged power in dB" for the complete time period. I use the following code : # Read 2s of data from wav file y, sr =…
Shan
  • 11
  • 5
1
vote
2 answers

Music visualizer using python and librosa

I'm trying to make a little script to generate some visualization of audio files in python. My ultimate goal is to generate a 30fps video made up from images collated generated in python assembling some image assets. But I'm a bit stuck with the…
Hirabayashi Taro
  • 933
  • 9
  • 17
1
vote
1 answer

Remove unwanted frequencies from tone

I am trying to generate a "beep" sound with a constant tone of 2350 Hz. I am using the code (which I got here) below to generate a WAV file with this tone that has a duration of 0.5 seconds. import math import wave import struct # Audio will…
coder
  • 381
  • 2
  • 22
1
vote
0 answers

How to compress two audio samples to be equally loud with librosa?

I'm trying to make two audio samples as similar as possible and my problem is that in one test-case their loudness isn't similar enough. data1, sr1 = librosa.load(path_1, sr=None) data2, sr2 = librosa.load(path_2, sr=None) Here are my plots of…
Cold_Class
  • 3,214
  • 4
  • 39
  • 82
1
vote
1 answer

Spectrogram image to Audio

I want to write a python script which takes the input as the image of the spectrogram and generates the audio from it. Is there a way to convert the image of spectrogram into corresponding audio ? I believe that there must be a way to reverse…
Hitesh Kumar
  • 193
  • 3
  • 11