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

AttributeError: 'MachAr' object has no attribute 'smallest_subnormal'

When importing librosa library, this error has occurred. C:\Users\jssong\anaconda3\envs\tensor_v2\lib\site-packages\numpy\core\getlimits.py:492: UserWarning: Signature b'\x9a\x99\x99\x99\x99\x99\xb9\xbf' for does not match…
송준석
  • 991
  • 1
  • 16
  • 32
1
vote
1 answer

AWS elastic beanstalk not working with Librosa python

My application works properly on the local machine. However, as I uploaded the application to elastic beanstalk, the import of librosa library broke the application. How to solve the issue? import os import pandas as pd import librosa import numpy…
1
vote
0 answers

FFT sound analysis yields the correct note but in another octave

I've been working on a python app that displays in order each note that is played in an audio file. I do this as follows: I split the audio samples into onsets, I run fft on each onset and get the frequency that has the highest magnitude. When I run…
1
vote
2 answers

How can I extract the data points (corresponding y value for x values) from a waveplot

I'm hoping this is an appropriate question for here. I have used Python Librosa to plot a wave form for a sound file. I'm finding it difficult to extract the data points. e.g. what is the value of y, at x (Time) = 0.15 on this output below. I can't…
ibukun
  • 11
  • 1
1
vote
2 answers

ValueError: x and y must have same first dimension, but have shapes (165,) and (166,)

I'm looping through a list of audio filenames, loading them, calculating the STE and RMSE, and then plotting said values. However, the occasional error message is thrown for about 20% of the files. ValueError: x and y must have same first dimension,…
Alice
  • 588
  • 1
  • 8
  • 25
1
vote
1 answer

Find the best decibel threshold to split an audio into segments with and without human voice in Python

I am trying to split audio into segments with and without human voice. I've started to use the method split from librosa and it does a really good job. The only problem I am having is to define the best threshold for silence. This method has an…
1
vote
0 answers

How can I make my program more RAM efficient?

I am using a dataset which has 750 sound segments, and I need to load them all in python. I am using librosa for that. The total size of all the files is 28 GB. When I execute the program to load them, the RAM on my environment (google colab) gets…
1
vote
1 answer

Failed to install Pytorch Snippets and Librosa in VScode - Apple M1

I anticipate I'm not an expert in informatics. I used to run PyTorch snippets for some deep learning on my old MacBook Pro (2015), but now I have Apple's last Pro, and have troubles with installing packages in VScode. Two of these packages give me…
mattiajoy
  • 11
  • 2
1
vote
0 answers

How to shift audio half a hop length?

So I have a deep neural network that generates features from audio like w2v2 (wave2vec 2). They get trained for a long time and resulting nets have some constant feature generation rate. I also happen to be able to generate Mel spectrograms, yet for…
DuckQueen
  • 772
  • 10
  • 62
  • 134
1
vote
1 answer

Python Tensorflow Shape Mismatch (WaveNet)

I was trying to run a WaveNet, which is specified in https://github.com/mjpyeon/wavenet-classifier/blob/master/WaveNetClassifier.py. Part of my code is as follows: def residual_block(self, x, i): tanh_out = Conv1D(self.n_filters,…
Jeong
  • 69
  • 5
1
vote
2 answers

Resampling audio file does not produce desired result

I want to resample a recording in 32000 KHz to 16000 KHz. I have done this with the code below. But the output audio is somewhat messed up. You can find the original audio as well output in the following…
imantha
  • 2,676
  • 4
  • 23
  • 46
1
vote
2 answers

how can I validate a perfect sine wave?

Background I'm trying to validate audio data received over RTP for its accuracy when compared to original source. In my system the audio is played by embedded platform devices and sent out on network for other devices to capture and play. it's specs…
user2669989
  • 308
  • 1
  • 2
  • 15
1
vote
1 answer

want to find the average length of audio in a bunch of audio files in a loop

Using this code for the same its working But how to display the average length of these audio files, also how to find maximum and minimum duration files? import librosa import glob import librosa path=glob.glob('E:/...*/*.wav') for i in…
1
vote
1 answer

Python librosa error "Audio buffer is not Fortran-contiguous"

I am using librosa Just load and stft, I hit the error Audio buffer is not Fortran-contiguous I googled around and found I need to add np.asfortranarray,So I add these sentences but in vain. a, sr =…
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
0 answers

python - understanding librosa.stft output shape

Why does lengthofinputsamples/hop_length not equal to the stft's output 2nd dimension. Instead, I noticed that the stft's output was equal to ceil(lengthofinputsamples/hop_length). Why is this? In my instance: sgram =…
Martin Tin
  • 11
  • 3