{"id":1534,"library":"librosa","title":"Librosa","description":"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.","status":"active","version":"0.11.0","language":"en","source_language":"en","source_url":"https://github.com/librosa/librosa","tags":["audio","music","signal processing","feature extraction","machine learning","spectrogram"],"install":[{"cmd":"pip install librosa","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for librosa.display functions; minimum version 3.5.0 since 0.11.0.","package":"matplotlib","optional":false},{"reason":"Required for full Python 3.13 support (manual install needed in some cases for 0.11.0).","package":"standard-aifc","optional":true},{"reason":"Required for full Python 3.13 support (manual install needed in some cases for 0.11.0).","package":"standard-sunau","optional":true},{"reason":"Optional backend for high-quality sample rate conversion, known issues with Python 3.13 on Windows.","package":"samplerate","optional":true}],"imports":[{"symbol":"librosa","correct":"import librosa"},{"symbol":"librosa.display","correct":"import librosa.display"},{"symbol":"librosa.feature","correct":"import librosa.feature"},{"symbol":"librosa.effects","correct":"import librosa.effects"},{"symbol":"librosa.util","correct":"import librosa.util"}],"quickstart":{"code":"import librosa\nimport librosa.display\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Generate a dummy audio signal for demonstration (5 seconds of random noise)\nsr = 22050 # sample rate\nduration = 5 # seconds\ny = np.random.randn(int(sr * duration))\n\n# In a real application, you'd load an audio file:\n# y, sr = librosa.load(\"path/to/your/audio.wav\", sr=None) # Use sr=None to preserve original sample rate\n\n# Compute Mel-frequency cepstral coefficients (MFCCs)\nmfccs = librosa.feature.mfcc(y=y, sr=sr, n_mfcc=13)\n\n# Display the MFCCs\nplt.figure(figsize=(10, 4))\nlibrosa.display.specshow(mfccs, x_axis='time', sr=sr, cmap='viridis')\nplt.colorbar()\nplt.title('MFCC (Mel-frequency cepstral coefficients)')\nplt.tight_layout()\n# plt.show() # Uncomment to display the plot\nprint(f\"MFCCs shape: {mfccs.shape}\")","lang":"python","description":"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."},"warnings":[{"fix":"Manually install `standard-aifc` and `standard-sunau`.","message":"For 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.","severity":"gotcha","affected_versions":"0.11.0"},{"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).","message":"Windows 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.","severity":"gotcha","affected_versions":"0.11.0"},{"fix":"Upgrade `matplotlib` to version 3.5.0 or newer: `pip install 'matplotlib>=3.5.0'`.","message":"Librosa 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.","severity":"breaking","affected_versions":"0.11.0+"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":"<0.11.0"},{"fix":"When loading audio, use `y, sr = librosa.load('path/to/audio.wav', sr=None)`.","message":"By 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}