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

Audio volume normalize python

I have multiple wave files, some are small volume and others are large volume. I want to "Normalize" sound amplitude. (Like the "Normalize" function that Some audio sequencer application has. Making volume bigger to the peak comes to the 0db.) For…
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
0 answers

How to show percentage of loaded file during librosa loading?

I'm loading a file in Python to mess with its audio. I found the librosa library for that - works great so far, but it takes some time to load the file. I would like to give a user live feedback on the loading progress so they'll know that nothing's…
Cold_Class
  • 3,214
  • 4
  • 39
  • 82
1
vote
0 answers

Is there any possible way to get from mp4 file path to get only the audio object in python?

I am trying to make a signal processing on audio signal and I am trying to skip the process of extracting first the audio from the mp4 file. There is any way to get the audio object directly from mp4 file using librosa or ffmpeg ?
Roiinbarr
  • 48
  • 4
1
vote
2 answers

How can I add rectangles and labels above an audio timeseries plot?

I am working with audio timeseries and want to better label areas that are being plotted. I believe this question is general to labelling timeseries data in matplotlib, but it may be important that I am also using librosa.display.waveplot to…
user391339
  • 8,355
  • 13
  • 58
  • 71
1
vote
1 answer

How do I call a librosa function on the entire audio file?

I have short audio files which I'm trying to analyze using Librosa, in particular the spectral centroid function. However, this function outputs an array of different values representing the spectral centroid at different frames within the audio…
Jodast
  • 1,279
  • 2
  • 18
  • 33
1
vote
0 answers

Is there a way to keep a frequency band while attenuating the rest?

Say I have an audio track with a variety of sounds ranging from low frequencies up to 20k. Is there a way I can filter away everything outside a given band and play back the result?
Alexander Soare
  • 2,825
  • 3
  • 25
  • 53
1
vote
0 answers

librosa mel spectrogram Hz scaling issue

I am having some odd vertical scaling issues with librosa.feature.melspectrogram(). It seems that when I use librosa.load() with sr=None, the Hz scale doesn't coincide with the intended spectrographic features. To investigate this further, I looked…
zenith7
  • 151
  • 1
  • 3
  • 8
1
vote
1 answer

Error importing librosa for TensorFlow: sndfile library not found

I'm trying to use TensorFlow Lite for a voice recognition project using Jupyter notebook but when I try to do a "import librosa" (using commands found here:…
Jaacob
  • 27
  • 1
  • 5
1
vote
1 answer

MFCC spectrogram vs Scipi Spectrogram

I am currently working on a Convolution Neural Network (CNN) and started to look at different spectrogram plots: With regards to the Librosa Plot (MFCC), the spectrogram is way different that the other spectrogram plots. I took a look at the…
Joe
  • 357
  • 2
  • 10
  • 32
1
vote
1 answer

How to transpose part of sound by librosa

For example, y, sr = librosa.load("sound.wav",sr=44100,mono=True) half = int(y.shape / 2) y1 = y[:half] y2 = y[half:] y_pit= librosa.effects.pitch_shift(y2, sr, n_steps=24) y = np.concatenate([y1,y_pit]) This code imports sound.wav and pitch-shift…
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
1 answer

Why I'm getting different sampling rate for same wav file with different libraries?

I'm trying to get the sampling rate of wav file using several python libraries, and I'm getting different results: (1): import wave wave_file = wave.open(fname, 'rb') frame_rate = wave_file.getframerate() output of frame_rate = 16000 (2): from…
Boom
  • 1,145
  • 18
  • 44
1
vote
2 answers

Is there a way to make fade out by librosa or another on python

For now I use librosa module to mix audio like this audio1 = "a.wav" audio2 = "b.wav" y1, sample_rate1 = librosa.load(audio1, mono=True,sr=22050,duration=50) y2, sample_rate2 = librosa.load(audio2, mono=True,sr=22050,duration=50) …
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
1 answer

What technologies I may use to write drum-pattern audio signal based recognition program?

as stated in the title of the question - What technologies I may use to write drum-pattern audio signal based recognition program? I want to create a tool for me as a drummer musician to transcribe a drum-part from a record. I imagine this as…
1
vote
0 answers

What is the difference of Short-time Frourier Transform Result calculated by librosa.stft and scipy.signal.stft?

I read the source codes of scipy.signal.stft and librosa.stft, and I noticed that the calculation of STFT of a signal in these two libraries are quite different: In scipy.signal.stft, the result is scaled by 1.0/win.sum(), where win.sum() represents…
Xiong
  • 11
  • 1
1
vote
0 answers

How to apply the following spectral wraping augmentation for an audio in python?

The feeling of this transformation for a spectrogram(where the x-axis is time and the y-axis is frequency) is somehow stretching it along the y-axis according to different values of alpha, while the top(maximum frequency) and the bottom(zero…