Computing WAV Audio Loudness Meter Using Python – Python Tutorial

By | December 3, 2021

When we are processing wav audio files, we may need know the loudness of a wav file. In this tutorial, we will introduce how to compute it using python.


We will use python pyloudnorm library to compute it, we should install it.

pip install pyloudnorm

pyloudnorm allows us to compute loudness meter of an audio file based on ITU-R BS.1770-4.

How to compute the loundess of a wav file?

Here is an example:

import soundfile as sf
import pyloudnorm as pyln

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

In this example, we will use python soundfile to read the wav data. You also can use or librosa.load() to read. Here is a tutorial:

The Difference Between and librosa.load() in Python – Python Tutorial

Then we will use meter.integrated_loudness() to compute loudess of this wav file.

Run this code, you will see:


As to our wav file:0055014.wav, it is a single channel audio.

The loudness of this wav file is -24.