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

Rhythm detection with python

i want to detect the rhythm of the given music or sound with python. And then print the rhythm time points to a file for using in my unity game. I've made some progress on this, but it's still not where I want it. It's missing some of notes. Here is…
Zekeriya Akgül
  • 308
  • 4
  • 14
1
vote
1 answer

Download and open file with librosa without writing to filesystem

I understand that Heroku dynos are ephemeral and files cannot be stored between requests. I have a Flask app that should get an MP3 from Spotify, pass it to LibROSA for analysis, then return a visualization. I have a script that works locally to…
Jasper Croome
  • 93
  • 1
  • 6
1
vote
0 answers

Appending numpy arrays of differing sizes when you don't know what maximum size you need?

I'm crawling across a folder of WAV files, with each file having the same sample-rate but different lengths. I'm loading these using Librosa and computing a range of spectral features on them. This results in arrays of different sizes due to the…
DrewTNBD
  • 41
  • 4
1
vote
1 answer

Librosa Display Waveplot, why are they totally blue and flat?

I followed this example of Music Synchronization with Dynamic Time Warping However, when I do this: import matplolib.pyplot as plt import librosa import librosa.display x_1, fs = librosa.load('musicdata/slow_melody.wav') plt.figure(figsize=(16,…
oldboy123
  • 61
  • 2
  • 8
1
vote
1 answer

Data Augmentation: What proportion of training dataset needs to be augmented?

I am currently working on a speech classification problem. I have 1000 audio files in each class and have 7 such classes. I need to augment data to achieve better accuracy. I am using librosa library for data augmentation. For every audio file, I am…
1
vote
1 answer

How to convert amplitude to dB in python using Librosa?

I have a few questions, which are all very related. The main problem here is to convert the amplitude of an audio file to dB scale and I am doing it as below which I am not sure is correct: y, sr = librosa.load('audio.wav') S =…
MRM
  • 1,099
  • 2
  • 12
  • 29
1
vote
1 answer

librosa producing "undetailed" MFCC spectrogram

I am trying to create an MFCC plot with librosa but the plot just doesn't appear to be very detailed. The goal is to present this MFCC spectrogram to a neural network. The audio file I am testing with is around 1 second long and is from the Google…
Harry Stuart
  • 1,781
  • 2
  • 24
  • 39
1
vote
1 answer

Isolating audio foreground and converting back to audio stream using librosa

I'm trying to isolate the foreground of an audio stream and then save it as a standalone audio stream using librosa. Starting with this seemingly relevant example. I have the full, foreground and background data isolated as the example does in…
user9548
  • 33
  • 1
  • 1
  • 7
1
vote
1 answer

How to get note in hz from one-shot audio sample using Python?

I need to get a note or tone of audio using python. I know about librosa.estimate_tuning, but I don't know how to convert it into hz. And maybe someone could say me another possible solution to my problem.
FlintCQ
  • 27
  • 1
1
vote
1 answer

Librosa Mel-Spectrogram log Shape

I am extracting a log Mel - spectrogram from the GTZAN dataset using Librosa in python. My code - data, sampling_rate = librosa.load(os.path.join(dir, folder, file), ) mel = librosa.feature.melspectrogram(y=data, hop_length = 512//2, n_fft = 512,…
user12218428
1
vote
1 answer

how to make the output of tf.signal.stft same as librosa.stft?

I want to pass gradient back through STFT in tensorflow. So I use tf.signal.stft instead of librosa.stft. However, their ouput are different. I want to fix certer=True for librosa.stft. I have refrenced to this. I find it didn't work for me.
zwy
  • 11
  • 1
1
vote
0 answers

Librosa's Resample Mismatch

I use the Librosa library to load and resamples the list of audio files. My code - for folder in os.listdir(dir): print(os.path.join(dir, folder)) for file in os.listdir(os.path.join(dir, folder)): if file.endswith("wav"): …
1
vote
0 answers

Librosa Plot Clarification

I am using librosa to process audio file, 'good.wav' is a 30-second audio file The code - data, sampling_rate = librosa.load('good.wav', ) plt.figure(figsize=(12, 4)) librosa.display.waveplot(data, sr=sampling_rate) Here, the sampling_rate =…
1
vote
2 answers

Convert spectrogram to audio using librosa functions

I am working on speech synthesis and I have constructed spectrograms using librosa. When I want to convert the spectrogram into audio to save as wav file, it creates problem. I looked for help and found that liborsa have a function mel_to_audio but…
shahid hamdam
  • 751
  • 1
  • 10
  • 24
1
vote
1 answer

librosa.load() not accurately decoding audio file from Youtube

I am trying to run the command librosa.load() on a .wav file. The .wav file was downloaded from a youtube video via youtube-dl and has the following properties: Number of channels: 2 Sample rate: 44,100Hz Duration: 3486.104 seconds However, the…
Vani N
  • 11
  • 1
  • 2