Skip to main content

LoudnessNormalizer Node

Brings audio to targetLoudness by slowly steering its gain, so sources mastered at different levels, such as radio stations and podcasts, play equally loud. Loudness is K-weighted (ITU-R BS.1770) over the last 3 seconds; silence and pauses don't count, and the gain holds through them. The gain moves 1 dB a second up and 3 dB a second down, within maxBoostDB and maxCutDB, ramped across each buffer. Call reset when a new source starts. Within a source it works as a slow automatic gain, so on music it raises any quiet passage longer than a few seconds and flattens the track's dynamics. It suits radio and podcasts, not matching music tracks to each other. Boosting can push peaks over 0 dBFS, so put a Switchboard.Limiter after it.


Configuration​

This object does not provide any configuration options.


Properties​

Inherits properties from its parents, Node, SwitchboardObject.

enabled​

Type: Boolean

Default: true

When false, the gain fades to 0 dB at 20 dB a second and the audio then passes through unchanged. When true again, it fades to the measured audio's gain just as fast.

gainDB (Read only)​

Type: Float

Unit: dB

The gain it applies now, in dB.

loudness (Read only)​

Type: Float

The input's loudness over the last 3 seconds, in LUFS, without silence and pauses. Through silence it keeps the last measurement; -70 until there's audio to measure.

maxBoostDB​

Type: Float

Default: 12.0
Range: 0.0 to 24.0
Unit: dB

The most it raises the audio, in dB.

maxCutDB​

Type: Float

Default: 12.0
Range: 0.0 to 24.0
Unit: dB

The most it lowers the audio, in dB.

targetLoudness​

Type: Float

Default: -14.0
Range: -40.0 to 0.0

The loudness to bring the audio to, in LUFS.


Actions​

Inherits actions from its parent, SwitchboardObject.

reset​

Forgets the measured loudness and sets the gain back to 0 dB, then follows the next audio fast until it's measured over 3 seconds. Call it when a new source starts.

Parameters​

None.

Return Value​

Boolean — true on success.


Events​

This object does not provide any events.


Example​

Internet radio at -14 LUFS, whichever station plays:

{
"nodes": [
{ "id": "player", "type": "Switchboard.AudioPlayer" },
{ "id": "normalizer", "type": "Switchboard.LoudnessNormalizer" },
{ "id": "limiter", "type": "Switchboard.Limiter" }
],
"connections": [
{ "sourceNode": "player", "destinationNode": "normalizer" },
{ "sourceNode": "normalizer", "destinationNode": "limiter" },
{ "sourceNode": "limiter", "destinationNode": "outputNode" }
]
}