Registry / data / pyloudnorm

pyloudnorm

JSON →
library0.2.0pypypi✓ verified 26d ago

pyloudnorm is an active Python library (version 0.2.0) that provides an implementation of the ITU-R BS.1770-4 loudness algorithm. It enables flexible and programmatic control over loudness measurement parameters, including integrated loudness (LUFS) and Loudness Range (LRA). The library is primarily feature-driven, with recent major updates introducing new capabilities and refining Python compatibility.

pip install pyloudnorm
INSTALL
IMPORT
SIG · PYLOUDNORM
P
pyloudnorm
datapythonv0.2.0
Install
7.6s avg
Import
2840ms
Disk
230MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.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
installs and imports cleanly · install 0.0s · import 2.862s · 230.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.6s · import 2.818s · 222MB
230MB installed
● package 230MB
Code
Verified usage

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

Meter
from pyloudnorm import Meter
import pyloudnorm as pyln meter = pyln.Meter(rate)

This quickstart demonstrates how to initialize a `pyloudnorm.Meter` and measure the integrated loudness (LUFS) and Loudness Range (LRA) of a dummy audio signal. It highlights the primary API calls for basic loudness analysis.

import numpy as np import pyloudnorm as pyln # Create dummy mono audio data (e.g., 2 seconds at 44.1 kHz) sample_rate = 44100 # Hz duration = 2.0 # seconds channels = 1 # mono data = np.random.uniform(-0.5, 0.5, int(sample_rate * duration)) # pyloudnorm expects a 2D array (samples, channels) if multi-channel, # or 1D array for mono if you adjust it. # For integrated_loudness, a 1D mono signal works directly. # Create a BS.1770 meter meter = pyln.Meter(sample_rate) # Measure the integrated loudness loudness = meter.integrated_loudness(data) print(f"Integrated Loudness: {loudness:.2f} LUFS") # Example for Loudness Range (LRA) - requires sufficient audio length # (Often more than 2 seconds, but demonstrating usage) lra = meter.loudness_range(data) print(f"Loudness Range: {lra:.2f} LU")
Debug
Known issues
breakingAs of version 0.2.0, pyloudnorm officially requires Python 3.9 or newer. Earlier Python versions (3.7, 3.8) are no longer supported.
fix
Upgrade your Python environment to 3.9 or a newer compatible version.
affects: >=0.2.0
gotchaThe `Meter` class must be initialized with the correct audio sample rate. Providing an incorrect sample rate will lead to inaccurate loudness measurements.
fix
Ensure the `sample_rate` argument passed to `pyln.Meter()` precisely matches the sample rate of your audio data.
affects: All versions
gotchaMeasuring integrated loudness or loudness range with very short audio segments (e.g., less than 400ms, due to internal block processing) may yield undefined or incorrect results.
fix
Provide audio data of sufficient length for meaningful measurements. For integrated loudness, generally at least 400ms is required for the gating algorithm to operate correctly.
affects: All versions
gotchaUsing very low sample rates (e.g., below 8000 Hz) can lead to numerical instability, overflow issues, or nonsensical loudness values, as the ITU-R BS.1770 algorithm is not intended for such rates. The library may produce very large positive numbers or -inf.
fix
Process audio at standard or typical audio sample rates (e.g., 44.1 kHz, 48 kHz). If working with very low-frequency audio, consider resampling or understand that loudness measurements might not be perceptually valid.
affects: All versions
Upgrade
Version history
0.2.0latest on PyPI · released Jan 4, 2026
Audit
Dependencies
numpyrequiredCore dependency for numerical operations and audio array handling.
scipyrequiredCore dependency for signal processing, especially filter design.
Agent activity
19 hits · last 30 days
node
18
Resources
pyloudnorm — pip install pyloudnorm · libregistry