Skip to content

The world's fastest Python package for calculating integrated loudness (LUFS) from audio data as NumPy arrays

License

Notifications You must be signed in to change notification settings

iver56/loudness

Repository files navigation

loudness

A Python package (battle-tested C++ under the hood) for calculating integrated loudness (LUFS) with the ITU BS.1770 loudness algorithm. Useful for EBU R 128 compliance. Takes NumPy arrays as input (supports mono and stereo/multichannel). Based on libloudness (original implementation by Magnus Bro Kolstø, Nomono).

Installation

PyPI version python 3.9, 3.10, 3.11, 3.12, 3.13 os: Linux, macOS, Windows

pip install loudness

Usage example

import soundfile as sf
import loudness

audio, sr = sf.read("audio.wav", dtype="float32")  # shape (samples, channels)
lufs = loudness.integrated_loudness(audio, sr)
print(f"{lufs:.2f} LUFS")

Performance

loudness is significantly faster than the alternatives:

Execution time comparison

Changelog

[0.1.0] - 2025-07-21

Initial release

For the complete changelog, go to CHANGELOG.md

Development setup

  • Install CMake and a C++ compiler
  • pip install numpy pybind11 build scikit-build-core
  • python -m build --wheel
  • Install the built wheel
  • pytest

About

The world's fastest Python package for calculating integrated loudness (LUFS) from audio data as NumPy arrays

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published