Loudness and dynamics
Measure loudness the EBU R128 way, master to a target, compress, limit and equalize.
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 )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The 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 )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The audio buffer. |
targetLufs | double | -14 | The loudness to reach. -14 suits streaming and video platforms, -16 podcasts, -23 broadcast (EBU R128). Defaults to -14. |
truePeak | double | -1 | The 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 )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The audio buffer. |
target | any | "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. |
truePeak | double | -1 | The highest peak in dBFS. Defaults to -1. |
glue | boolean | false | True 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" )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The audio buffer. |
thresholdDb | double | -18 | Level above which the audio is turned down, in dB. Defaults to -18. |
ratio | double | 4 | How strongly: 4 means 4 dB over the threshold becomes 1 dB. Defaults to 4. |
attack | double | 10 | Milliseconds to turn down. Defaults to 10. |
release | double | 100 | Milliseconds to turn back up. Defaults to 100. |
knee | double | 6 | Width in dB of the soft knee. 0 is a hard knee. Defaults to 6. |
makeupDb | any | "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 )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The audio buffer. |
ceilingDb | double | -1 | The highest sample level in dB, at most 0. Defaults to -1. |
release | double | 100 | Milliseconds to recover after a peak. Defaults to 100. |
lookAhead | double | 5 | Milliseconds 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 )
| Argument | Type | Default | |
|---|---|---|---|
audio | any | required | The audio buffer. |
bands | array | required | An 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.