Registry / ai-ml / librosa

librosa

JSON →
library1.0.0pypypi✓ verified 25d ago

Librosa is a Python module for audio and music processing, providing a wide array of tools for analysis, feature extraction, and manipulation of audio signals. The current version is 0.11.0, with regular updates that typically include bug fixes, performance improvements, and minor feature enhancements, aiming for stable releases every few months.

pip install librosa
INSTALL
IMPORT
SIG · LIBROSA
L
librosa
ai-mlpythonv1.0.0
Install
15.7s avg
Import
10ms
Disk
490MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.11.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 15.7s · import 0.010s · 484MB
490MB installed
● package 490MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

librosa
import librosa
librosa.display
import librosa.display
librosa.feature
import librosa.feature
librosa.effects
import librosa.effects
librosa.util
import librosa.util

This quickstart demonstrates how to generate a dummy audio signal (or load a real one), compute Mel-frequency cepstral coefficients (MFCCs), and visualize them using `librosa.display` and `matplotlib`. Remember to replace the dummy signal with `librosa.load` for actual audio files.

import librosa import librosa.display import matplotlib.pyplot as plt import numpy as np # Generate a dummy audio signal for demonstration (5 seconds of random noise) sr = 22050 # sample rate duration = 5 # seconds y = np.random.randn(int(sr * duration)) # In a real application, you'd load an audio file: # y, sr = librosa.load("path/to/your/audio.wav", sr=None) # Use sr=None to preserve original sample rate # Compute Mel-frequency cepstral coefficients (MFCCs) mfccs = librosa.feature.mfcc(y=y, sr=sr, n_mfcc=13) # Display the MFCCs plt.figure(figsize=(10, 4)) librosa.display.specshow(mfccs, x_axis='time', sr=sr, cmap='viridis') plt.colorbar() plt.title('MFCC (Mel-frequency cepstral coefficients)') plt.tight_layout() # plt.show() # Uncomment to display the plot print(f"MFCCs shape: {mfccs.shape}")
Debug
Known issues
gotchaFor Python 3.13 environments, `librosa` 0.11.0 may require manual installation of `standard-aifc` and `standard-sunau` packages (`pip install standard-aifc standard-sunau`) for full compatibility. This is not needed for Python 3.12 or earlier.
fix
Manually install `standard-aifc` and `standard-sunau`.
affects: 0.11.0
gotchaWindows users on Python 3.13 may encounter problems with the optional `samplerate` backend package for sample rate conversion. This may lead to `librosa.load` or `librosa.resample` issues if `samplerate` is used.
fix
Consider using Python 3.12 or earlier, or rely on `resampy` as the default backend (which is automatically chosen if `samplerate` fails or is not installed).
affects: 0.11.0
breakingLibrosa 0.11.0 bumps the minimum required `matplotlib` version to 3.5.0. Using an older version of `matplotlib` can lead to import errors or unexpected display behavior.
fix
Upgrade `matplotlib` to version 3.5.0 or newer: `pip install 'matplotlib>=3.5.0'`.
affects: 0.11.0+
gotchaThe `norm` argument in `librosa.feature.mfcc` had a name collision issue in earlier versions. This was fixed in 0.11.0, meaning the behavior of `norm='ortho'` or `norm='none'` might differ from previous versions.
fix
Review code that uses the `norm` argument in `mfcc` when upgrading to 0.11.0 to ensure intended behavior, especially if `norm='ortho'` was previously used.
affects: <0.11.0
gotchaBy default, `librosa.load` resamples audio to `sr=22050` Hz. If you need to preserve the original sample rate, always specify `sr=None`. Not doing so is a common source of unexpected behavior or data loss.
fix
When loading audio, use `y, sr = librosa.load('path/to/audio.wav', sr=None)`.
affects: All versions
breakingWhen installing `librosa` or its dependencies (e.g., `scikit-learn`, `numpy`, `scipy`) in minimal environments like Alpine Linux, a C compiler and other build tools are often required but not pre-installed. This can lead to compilation errors during package installation, preventing `librosa` and its dependencies from being successfully installed.
fix
Ensure build essentials are installed in your environment. For Alpine Linux, use `apk add build-base python3-dev`.
affects: All versions
Upgrade
Version history
1.0.0latest on PyPI · released Aug 11, 2026
Audit
Dependencies
matplotlibrequiredRequired for librosa.display functions; minimum version 3.5.0 since 0.11.0.
standard-aifcoptionalRequired for full Python 3.13 support (manual install needed in some cases for 0.11.0).
standard-sunauoptionalRequired for full Python 3.13 support (manual install needed in some cases for 0.11.0).
samplerateoptionalOptional backend for high-quality sample rate conversion, known issues with Python 3.13 on Windows.
Agent activity
19 hits · last 30 days
node
14
Resources
librosa — pip install librosa · libregistry