librosa
Python module for audio and music processing
What it is and what it does
librosa is a foundational Python library for audio and music signal processing, designed to support music information retrieval (MIR) research and applications. It provides algorithms for feature extraction, spectral analysis, and music analysis tasks. The library depends on scientific computing foundations (numpy, scipy, scikit-learn) and uses numba for performance-critical code, plus soundfile and soxr for audio I/O and resampling.
Developers use librosa to extract features from audio (mel-spectrograms, chroma, MFCC, onset detection), analyze musical structure, and build systems that understand or process music. It's production-stable (Development Status 5), actively maintained with a recent release, and widely adopted in music technology and research.
Use it for:
- Extract mel-spectrograms and other acoustic features from audio files for machine learning models.
- Detect musical onsets, beats, and tempo to analyze rhythm and timing in recordings.
- Compute chroma features and harmonic/percussive separation for music analysis and transcription tasks.
- Build music recommendation or similarity systems using librosa feature vectors.
- Analyze audio for speech processing, environmental sound classification, or audio event detection.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
librosa provides audio and music signal processing algorithms and tools for building music information retrieval systems in Python.
Yes. librosa is production-stable, actively maintained, has low install friction, carries a permissive license, and is the standard Python library for audio and music signal processing. Install it if you need to work with audio features, music analysis, or MIR tasks. No known security vulnerabilities.
Install
librosa on PyPI
pip
pip install librosauv
uv add librosapoetry
poetry add librosaInstalling librosa
Before you install
Low friction: pure Python wheel available, active maintenance with release 3 days ago, 11 runtime dependencies all widely used (numba, numpy, scipy, scikit-learn, joblib, soundfile, pooch, soxr, decorator, lazy_loader, msgpack).
License in practice
ISC license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install librosa
import librosa
y, sr = librosa.load('audio.wav')
S = librosa.feature.melspectrogram(y=y, sr=sr)
Requires Python 3.12 or later; soundfile and soxr may require system audio libraries depending on your platform.
Verify before relying
- Whether soxr and soundfile have platform-specific system dependencies that could affect installation on Windows, macOS, or Linux.
- Performance characteristics when processing very large audio files or real-time streaming scenarios.
Package facts
| License | ISC (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — numba, numpy, scipy, scikit-learn, joblib, decorator, soundfile, pooch, soxr, lazy_loader, msgpack |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 13,551,389/month — #1,274 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: librosa-1.0.0-py3-none-any.whl
Tags
More Analysis packages
Pydub provides a high-level Python interface…
permissive · top 5,000 on PyPI
soxrPerforms high-quality sample-rate conversion…
copyleft · top 5,000 on PyPI
moviepyMoviePy is a Python library for video editing…
permissive · top 5,000 on PyPI
tinytagReads metadata (artist, title, duration,…
permissive · top 5,000 on PyPI
kaldiioKaldiio reads and writes Kaldi archive (ark)…
unclear · top 5,000 on PyPI
mir-evalmir_eval computes standard accuracy metrics for…
permissive · top 15,000 on PyPI
pylastpylast provides a Python interface to Last.fm…
permissive · top 15,000 on PyPI
torchlibrosaProvides PyTorch implementations of librosa…
permissive · top 15,000 on PyPI
pretty-midiProvides utilities for reading, modifying, and…
permissive · top 15,000 on PyPI
aubioaubio is a Python wrapper around a C library…
copyleft · top 15,000 on PyPI
music21music21 is a Python toolkit for analyzing,…
permissive · top 15,000 on PyPI
symusicsymusic parses and transforms MIDI and ABC…
permissive · top 15,000 on PyPI
musicbrainzngsProvides Python bindings to query the…
permissive · top 15,000 on PyPI
python-stretchPitch-shifts and time-stretches audio using the…
permissive · top 15,000 on PyPI
syncedlyricsFetches synchronized lyrics in LRC format for…
permissive · top 15,000 on PyPI