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

How to change size size of mel-spectograms?

I want to save 3 mel-spectograms to one png file. I used the subplots function for this. fig, ax = plt.subplots(nrows=3, ncols=1) img1 = librosa.display.specshow(S_dB1, sr=sr, fmax=10000, ax=ax[0]) img2 = librosa.display.specshow(S_dB2, sr=sr,…
Gandalf69
  • 65
  • 8
1
vote
1 answer

The use of librosa.effects.trim to remove the silent part in audio

I am doing a speech emotion recognition ML. I currently use pyAudioAnalysis to do a multi-directory feature extraction. However, the dataset involved in audios containing a lot of approximately silent sections. My objective is to remove the…
Leo
  • 153
  • 2
  • 19
1
vote
1 answer

Effect of window shifting in spectrogram?

I am quite new in DSP and generating the spectrogram of an audio file. My spectrogram is not smooth and it is showing the quite raw image with pixel values, something like this While I am looking for a smooth spectrogram like this Where I am doing…
Aaditya Ura
  • 12,007
  • 7
  • 50
  • 88
1
vote
0 answers

Is there a way to get a frequencies list from librosa.display.specshow?

I'm trying to extract frequencies upper certain dB from the code below. I think the following code calculates the frequency and display the spectrogram with C_db, how can I get the frequencies list upper certain dB? import librosa.display,…
babbluesy
  • 11
  • 3
1
vote
0 answers

How to make torchaudio and librosa MFCC calculations equivalent?

I've seen this question concerning the same type of issue between librosa, python_speech_features and tensorflow.signal. I am trying to make torchaudio and librosa compute MFCC features with the same arguments and underlying methods. This is part of…
Mario Ishac
  • 5,060
  • 3
  • 21
  • 52
1
vote
0 answers

Is their any way for transcribe an large audio file by python and librosa?

I am trying to do by so many platform. Firstly i tried with speech recognition module but this is not working. Secondly i tried with wit.ai but it can't process large file. At lastly i tried with aws transcribe but I have a student account so I…
1
vote
1 answer

What are 'order' and 'critical frequency' when creating a low pass filter using `scipy.signal.butter()`

Context: I'm trying to create a low pass filter to cut off frequencies above 10khz of a soundfile. import librosa import scipy.signal as sig import numpy as np import matplotlib.pyplot as plt filename = librosa.example('nutcracker') y, sr =…
rocksNwaves
  • 5,331
  • 4
  • 38
  • 77
1
vote
1 answer

Shape of librosa.feature.melspectrogram

I'm trying to understand the output of librosa.feature.melspectrogram: >>> import numpy as np >>> from librosa.feature import melspectrogram >>> >>> >>> melspectrogram(np.random.randn(128), n_mels=128).shape (128, 1) >>>…
ignoring_gravity
  • 6,677
  • 4
  • 32
  • 65
1
vote
1 answer

how to install librosa on raspberry Pi 3?

so i was trying to install librosa on my raspberry pi 3 using sudo pip3 install librosa but it not working it showing me Collecting librosa Using cached https://www.piwheels.org/simple/librosa/librosa-0.8.0-py3-none-any.whl librosa requires Python…
Bouchra
  • 11
  • 1
1
vote
2 answers

MPEG Audio Constant bit rate conversion

I am trying to convert few .wav files to .mp3 format The desired .mp3 format is : I tried with FFmpeg with this code : ffmpeg -i input.wav -vn -ac 2 -b:a 160k output1.mp3 This is the output of this command on one .wav format I am getting the…
Aaditya Ura
  • 12,007
  • 7
  • 50
  • 88
1
vote
1 answer

TypeError: float() argument must be a string or a number, not 'PolyCollection'

I am trying to plot an audio file using librosa.display.waveplot(y,sr) my code: import librosa.display ax1 = plt.subplot(gs[1]) y, sr = librosa.load("Audiofilepath") ax1.plot(librosa.display.waveplot(y, sr)) I got the result plotted. Even though I…
Subbu VidyaSekar
  • 2,503
  • 3
  • 21
  • 39
1
vote
0 answers

Censor Audio in Python [add bleep sound to audio]

I am creating a text to speech api, and i would like to give the user options to customize text, this includes a variety of things, one of which is censoring. I want to give the user the option to censor some words, the use can input something…
Imtinan Azhar
  • 1,725
  • 10
  • 26
1
vote
1 answer

AudioSegment to Librosa

i,m writing a code using pydub module to get data from an audio file , but i want to do the same actions using librosa module , how to convert my code and get the same result with librosa here's my code : import numpy as np from pydub import…
noob
  • 11
  • 2
1
vote
0 answers

Traceback error is thrown when librosa is imported

I imported librosa package via python shell as following: python -m pip install librosa The import was successful.When I ran init.py of my librosa core, it threw this type of error. > Traceback (most recent call last): File…
Supraja
  • 11
  • 7
1
vote
1 answer

Is there a way using librosa's waveplot to store the coordinates of the graph rather than show the image of the waveplot?

I am working on an audio project where I am using Librosa and have the following code from an example online. Rather than opening up an image with a graph of the amplitude versus time, I want to be able to store the coordinates that make up the…
Alan Esses
  • 11
  • 1