True Peak Safety
True peak safety is the practice of leaving enough margin so a mastered file does not clip after reconstruction, codec conversion, or streaming playback.
Sample peaks only show the values stored in the digital file. Playback systems and encoders reconstruct a continuous waveform between those samples, and the part that rises above the stored peaks is an inter-sample peak (ISP). True Peak explains what that is and how it is measured; this page is about the margin you leave for it.
This matters most when:
| Situation | Risk |
|---|---|
| Lossy encoding | MP3, AAC, or Opus conversion can create new peaks. |
| Loud limiting | Dense masters leave less room for reconstruction overshoot. |
| Streaming normalization | Playback pipelines may transcode or process the file. |
| Consumer devices | Some playback chains handle near-0 dBFS material poorly. |
Even when the sample-peak meter looks safe, codec conversion and device-side reconstruction can lift peaks. Right before release, check both the exported WAV and a quick render through the expected delivery codec, such as MP3, AAC, or Opus.
Practical Ceiling
The ceiling is the highest level the limiter will let through. A common release ceiling is around -1 dBTP — decibels true peak, the same decibel scale as dBFS but measured on the reconstructed waveform. Some workflows use -2 dBTP for extra codec safety; others use a tighter ceiling when the destination is known and controlled. The engine's club and cd delivery targets use -0.3 dBTP together with -9 LUFS, which trades codec safety for density; streaming, broadcast, and podcast targets use -1.
-1 dBTP is not a universal law, but it is a practical starting point because it leaves room for platform encoding and playback reconstruction. If raising the ceiling adds harshness or distortion after export, prioritize safety over a small loudness increase.
The ceiling is not a loudness target. It is a safety margin. You can have a quiet file with unsafe peaks or a loud file that stays within true-peak limits. It is also separate from the loudness target: raising the ceiling to gain LUFS buys a little level now and pays for it with clipping after conversion. If the target is out of reach, look at how much gain reduction the limiter is doing and fix it earlier in the chain (input gain, compression, low-end balance).
Limiter Lookahead
A true-peak limiter needs time to react before the peak arrives. Lookahead gives the limiter that time. Too little lookahead can miss fast peaks. Too much lookahead can increase latency and may change transient feel.
The limiter's gain reduction starts lookaheadMs before the peak reaches the output and recovers over roughly releaseMs, so the output stays under the ceiling. The figure below shows it at the defaults listed further down. In offline mastering, a few milliseconds of lookahead is usually acceptable because playback latency does not matter. In live or interactive systems, latency matters more.
- input
- output (delayed by the lookahead)
- limiter gain
- ceiling
The limiter's defaults:
| Setting | Default |
|---|---|
ceilingDb | -1 |
lookaheadMs | 1.0 |
releaseMs | 50 |
oversampleFactor | 4 |
Measure it in libsonare
The meter (True Peak) and the limiter both oversample 4x by default and accept 1, 2, 4, 8 or 16. Limiting to a ceiling is a chain stage, maximizer.truePeakLimiter.
import { init, meteringPeakDb, meteringTruePeakDb, masteringChain } from '@libraz/libsonare';
await init();
const samplePeak = meteringPeakDb(samples, sampleRate);
const truePeak = meteringTruePeakDb(samples, sampleRate); // 4x oversampling
const finer = meteringTruePeakDb(samples, sampleRate, 8); // 1, 2, 4, 8 or 16
const limited = masteringChain(samples, sampleRate, {
maximizer: { truePeakLimiter: { ceilingDb: -1, lookaheadMs: 1, oversampleFactor: 4 } },
});
// limited.samples holds the result; limited.outputTruePeakDbtp reads -1.0 for drum.wavimport libsonare as sonare
audio = sonare.Audio.from_file("song.wav")
sample_peak = audio.peak_db()
true_peak = audio.true_peak_db() # oversample_factor=4
finer = audio.true_peak_db(oversample_factor=8)
limited = sonare.mastering_chain(
audio.data, audio.sample_rate,
{"maximizer": {"truePeakLimiter": {"ceilingDb": -1, "lookaheadMs": 1, "oversampleFactor": 4}}},
)sonare-cli meter song.wav # native CLI only: sample peak and true peak (--oversample sets the factor)
sonare mastering-processor song.wav --processor maximizer.truePeakLimiter \
--params ceilingDb=-1,lookaheadMs=1 -o limited.wavThe mastering demo's Studio mode exposes the same ceiling and lookahead controls.
What to Check by Ear
True peak problems often appear where kick and bass hit together, where cymbals are loud in a chorus, or after saturation creates sharp peaks. Listen for small bursts of grit, splashy cymbals, or low-end clicks that were not present before limiting.
If lowering the ceiling barely changes the sound, choose the safer setting. If lowering it removes punch immediately, do not solve the whole problem at the limiter; revisit dynamics, saturation, or input level earlier in the chain.
Implementation notes
The safety check uses the same principle as true-peak metering: estimate the reconstructed waveform by oversampling, then evaluate the highest sample on that denser grid. A limiter that only clamps original samples can still leave inter-sample overs, so the guard has to observe the oversampled path, not just the input buffer.
Lookahead and release are coupled.
Lookahead gives the limiter a chance to begin attenuation before the peak. Release determines how quickly it returns to unity gain.
A very short release can produce audible pumping or a distortion-like flutter. A very long release can dull transients and reduce loudness headroom. The practical setting is a compromise between codec safety, transient preservation, and audible gain movement.
Related: True Peak, LUFS, Loudness Matching