Skip to content

LoudnessNormalization

Added in v0.14.0

Apply a constant amount of gain to match a specific loudness (in LUFS). This is an implementation of ITU-R BS.1770-4.

For an explanation on LUFS, see https://en.wikipedia.org/wiki/LUFS

See also the following web pages for more info on audio loudness normalization:

Warning: This transform can return samples outside the [-1, 1] range, which may lead to clipping or wrap distortion, depending on what you do with the audio in a later stage. See also https://en.wikipedia.org/wiki/Clipping_(audio)#Digital_clipping

LoudnessNormalization API

min_lufs_in_db: float • unit: LUFS
⚠ Deprecated as of v0.31.0, removed as of v0.38.0. Use min_lufs instead
max_lufs_in_db: float • unit: LUFS
⚠ Deprecated as of v0.31.0, removed as of v0.38.0. Use max_lufs instead
min_lufs: float • unit: LUFS
Default: -31.0. Minimum loudness target.
max_lufs: float • unit: LUFS
Default: -13.0. Maximum loudness target.
p: float • range: [0.0, 1.0]
Default: 0.5. The probability of applying this transform.

Source code

audiomentations/augmentations/loudness_normalization.py