Loudness and dynamics

Measure loudness the EBU R128 way, master to a target, compress, limit and equalize.

On this page

Measure loudness the EBU R128 way, master to a target, compress, limit and equalize.

audioLoudness

Measure the loudness of audio as EBU R128 does: integrated LUFS, loudness range, true peak

audioLoudness( audio )
ArgumentTypeDefault
audioanyrequiredThe audio buffer.

Returns A struct with integrated (LUFS, gated, the number streaming services use), range (LU), truePeak and samplePeak (dBFS), momentaryMax and shortTermMax (LUFS). Silence or audio shorter than 400 ms reads -120.

audioNormalizeLoudness

Set the integrated loudness of audio to a target in LUFS, keeping peaks under a true-peak ceiling

audioNormalizeLoudness( audio, targetLufs=-14, truePeak=-1 )
ArgumentTypeDefault
audioanyrequiredThe audio buffer.
targetLufsdouble-14The loudness to reach. -14 suits streaming and video platforms, -16 podcasts, -23 broadcast (EBU R128). Defaults to -14.
truePeakdouble-1The highest peak allowed in dBFS. A limiter catches what the gain pushes over it. Defaults to -1.

Returns A new audio buffer.

audioMaster

Master audio for delivery: reach a loudness target with a true-peak ceiling, optionally gluing the mix with light compression

audioMaster( audio, target="streaming", truePeak=-1, glue=false )
ArgumentTypeDefault
audioanyrequiredThe audio buffer.
targetany"streaming"A preset name or a number in LUFS. streaming is -14, podcast -16, game -16, broadcast -23 (EBU R128), cinema -24. Defaults to streaming.
truePeakdouble-1The highest peak in dBFS. Defaults to -1.
gluebooleanfalseTrue to compress lightly (2:1, slow) before normalizing so the mix sounds more even. Defaults to false.

Returns A new audio buffer.

audioCompress

Reduce the dynamic range of audio with a compressor

audioCompress( audio, thresholdDb=-18, ratio=4, attack=10, release=100, knee=6, makeupDb="auto" )
ArgumentTypeDefault
audioanyrequiredThe audio buffer.
thresholdDbdouble-18Level above which the audio is turned down, in dB. Defaults to -18.
ratiodouble4How strongly: 4 means 4 dB over the threshold becomes 1 dB. Defaults to 4.
attackdouble10Milliseconds to turn down. Defaults to 10.
releasedouble100Milliseconds to turn back up. Defaults to 100.
kneedouble6Width in dB of the soft knee. 0 is a hard knee. Defaults to 6.
makeupDbany"auto"Gain added after compression in dB, or "auto" to match the loudness (RMS) of the input. Defaults to auto.

Returns A new audio buffer.

audioLimit

Stop audio from going above a ceiling with a look-ahead limiter

audioLimit( audio, ceilingDb=-1, release=100, lookAhead=5 )
ArgumentTypeDefault
audioanyrequiredThe audio buffer.
ceilingDbdouble-1The highest sample level in dB, at most 0. Defaults to -1.
releasedouble100Milliseconds to recover after a peak. Defaults to 100.
lookAheaddouble5Milliseconds the limiter looks ahead. Defaults to 5.

Returns A new audio buffer.

audioEq

Shape the tone of audio with parametric equalizer bands

audioEq( audio, bands )
ArgumentTypeDefault
audioanyrequiredThe audio buffer.
bandsarrayrequiredAn array of structs, each with type (peak, lowshelf, highshelf, lowpass, highpass or notch), freq in Hz, gain in dB (peak and shelves) and optionally q (width, default 1 for a peak and 0.707 for others).

Returns A new audio buffer.

Edit this page Download Markdown Last updated Oct 16, 2026, 11:59:46 AM Report an issue