Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pyloudnorm

> 编程语言
Open source

Flexible audio loudness meter in Python with implementation of ITU-R BS.1770-4 loudness algorithm

776 stars0 likes2 views
WebsiteGitHub

About

Flexible audio loudness meter in Python with implementation of ITU-R BS.1770-4 loudness algorithm

pyloudnorm

Flexible audio loudness meter in Python.

Implementation of ITU-R BS.1770-4.

Allows control over gating block size and frequency weighting filters for additional control.

For full details on the implementation see our paper with a summary in our AES presentation video.

Installation

You can install with pip as follows

bash
pip install pyloudnorm

For the latest releases always install from the GitHub repo

bash
pip install git+https://github.com/csteinmetz1/pyloudnorm

Usage

Find the loudness of an audio file

It's easy to measure the loudness of a wav file. Here we use PySoundFile to read a .wav file as an ndarray.

python
import soundfile as sf
import pyloudnorm as pyln

data, rate = sf.read("test.wav") # load audio (with shape (samples, channels))
meter = pyln.Meter(rate) # create BS.1770 meter
loudness = meter.integrated_loudness(data) # measure loudness

Loudness normalize and peak normalize audio files

Methods are included to normalize audio files to desired peak values or desired loudness.

python
import soundfile as sf
import pyloudnorm as pyln

data, rate = sf.read("test.wav") # load audio

# peak normalize audio to -1 dB
peak_normalized_audio = pyln.normalize.peak(data, -1.0)

# measure the loudness first 
meter = pyln.Meter(rate) # create BS.1770 meter
loudness = meter.integrated_loudness(data)

# loudness normalize audio to -12 dB LUFS
loudness_normalized_audio = pyln.normalize.loudness(data, loudness, -12.0)

Loudness range

Attempt to measure the Loudness Range (LRA) of an audio file based on EBU Tech 3342. LRA quantifies the variation in loudness over time, measured in LU (Loudness Units).

python
import soundfile as sf
import pyloudnorm as pyln

data, rate = sf.read("test.wav") # load audio

meter = pyln.Meter(rate) # create BS.1770 meter
lra = meter.loudness_range(data) # measure loudness range

print(f"Loudness Range: {lra:.1f} LU")

Advanced operation

A number of alternate weighting filters are available, as well as the ability to adjust the analysis block size. Examples are shown below.

…

Dependencies

  • SciPy (https://www.scipy.org/)
  • NumPy (http://www.numpy.org/)

Citation

If you use pyloudnorm in your work please consider citing us.

@inproceedings{steinmetz2021pyloudnorm,
        title={pyloudnorm: {A} simple yet flexible loudness meter in Python},
        author={Steinmetz, Christian J. and Reiss, Joshua D.},
        booktitle={150th AES Convention},
        year={2021}}

References

Ian Dash, Luis Miranda, and Densil Cabrera, "Multichannel Loudness Listening Test," 124th International Convention of the Audio Engineering Society, May 2008

Pedro D. Pestana and Álvaro Barbosa, "Accuracy of ITU-R BS.1770 Algorithm in Evaluating Multitrack Material," 133rd International Convention of the Audio Engineering Society, October 2012

Pedro D. Pestana, Josh D. Reiss, and Álvaro Barbosa, "Loudness Measurement of Multitrack Audio Content Using Modifications of ITU-R BS.1770," 134th International Convention of the Audio Engineering Society, May 2013

Steven Fenton and Hyunkook Lee, "Alternative Weighting Filters for Multi-Track Program Loudness Measurement," 143rd International Convention of the Audio Engineering Society, October 2017

Brecht De Man, "Evaluation of Implementations of the EBU R128 Loudness Measurement," 145th International Convention of the Audio Engineering Society, October 2018.

Tensorized/Differentiable Implementations

For use in differentiable contexts, such as part of a loss function, there are the following implementations:

  • PyTorch: Descript Inc.'s audiotools
  • Jax: jaxloudnorm

Issues· 14 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言