librosa
Python library for audio and music analysis, from spectrograms to beat tracking and features.
About
Nearly every open source audio machine learning project depends on librosa somewhere in its pipeline. The package provides reference Python implementations for audio loading and resampling, short-time Fourier transforms, mel spectrograms, constant-Q transforms, beat and tempo tracking, onset detection, pitch estimation, harmonic-percussive separation, and the standard features like MFCCs and chroma used to feed models. Built on NumPy and SciPy, the API favors plain arrays over custom objects, which is why it composes so easily with PyTorch and scikit-learn workflows, and everything runs on CPU with no GPU or network access needed after a pip or conda install. Development continues as an active community project with around 8,500 GitHub stars, versioned documentation at librosa.org, and an accompanying SciPy conference paper as the standard citation. The code is ISC licensed, a permissive license equivalent in effect to MIT, so commercial use is unrestricted. For feature extraction, dataset preparation, and music information retrieval research it remains the default tool more than a decade after its first release.
Should you use librosa?
Pick it when
Pick librosa for CPU-only feature extraction and dataset prep: mel spectrograms, MFCCs, chroma, onset and beat tracking, pitch, or resampling before training a model, especially in music information retrieval work.
Look elsewhere when
Skip it when you need learned models rather than signal processing: it will not transcribe, separate stems cleanly, or tell speakers apart. Use Demucs for stems, pyannote.audio for who spoke when, and a Whisper variant for text.
Alternatives to librosa
- Demucs
Learned separation into drums, bass, vocals, and other, which librosa's harmonic-percussive split cannot match, but it wants a 3 GB GPU or runs at about 1.5x audio length on CPU.
- Pyannote Audio
Answers who spoke when and where speech occurs, which librosa features cannot, but it is a PyTorch model stack that wants a GPU with about 4 GB.
- SpeechBrain
PyTorch toolkit with pretrained speech models for 20+ tasks and GPU training, much heavier than librosa's plain NumPy feature functions.
- Basic Pitch
Turns polyphonic audio into MIDI notes on CPU, where librosa's pitch estimation follows a single line, but it gives you notes rather than feature arrays to feed a model.
Reviews (0)
Leave a Review
No reviews yet. Be the first to review!
Details
- Category
- Audio & Speech
- Price
- Free
- Platform
- Local/Desktop
- Difficulty
- Easy (2/5)
- License
- ISC
- Added
- Jul 29, 2026