Table of Contents

Class LimiterEffect

Namespace
NAudio.Effects
Assembly
NAudio.Core.dll

Brick-wall peak limiter with look-ahead and optional true-peak (inter-sample) detection. The signal is delayed by the look-ahead time while a channel-linked peak detector sees the audio early, so gain is already reduced by the time a transient reaches the output — no overshoot, no audible pumping from a hard catch. With TruePeak enabled the detector measures the oversampled signal, so reconstruction (inter-sample) peaks are caught too. Gain recovers with a smooth release. Reports its look-ahead as LatencySamples for delay compensation.

public sealed class LimiterEffect : AudioEffect, IAudioEffect, IParameterized
Inheritance
LimiterEffect
Implements
Inherited Members

Properties

CeilingDb

Output ceiling in dBFS (peaks are held at or below this). Default -0.3 dB.

public float CeilingDb { get; set; }

Property Value

float

GainReductionDb

The most recent gain reduction in dB (≥ 0), for metering.

public float GainReductionDb { get; }

Property Value

float

LatencySamples

Processing latency the effect introduces, in samples per channel. Zero for effects with no inherent delay; non-zero for look-ahead or block/partitioned designs that need delay compensation in a chain.

public override int LatencySamples { get; }

Property Value

int

LookaheadMs

Look-ahead time in milliseconds. Default 5 ms. Must be positive.

public float LookaheadMs { get; set; }

Property Value

float

OversampleFactor

Oversampling factor for true-peak detection: 1, 2 or 4. Default 4.

public int OversampleFactor { get; set; }

Property Value

int

Parameters

Generic parameter list (excludes Bypass/Mix, which are on the base).

public IReadOnlyList<EffectParameter> Parameters { get; }

Property Value

IReadOnlyList<EffectParameter>

ReleaseMs

Release time in milliseconds. Default 50 ms.

public float ReleaseMs { get; set; }

Property Value

float

TruePeak

When true, detect inter-sample (true) peaks on the oversampled signal so reconstruction overshoot cannot exceed the ceiling. Default true.

public bool TruePeak { get; set; }

Property Value

bool

Methods

OnConfigure(WaveFormat)

Called by Configure(WaveFormat) after the format is stored. Derived effects allocate and size their sample-rate-dependent state here.

protected override void OnConfigure(WaveFormat format)

Parameters

format WaveFormat

ProcessBlock(Span<float>)

Transforms buffer in place into the fully-wet signal. The base class handles dry/wet mixing and bypass around this call.

protected override void ProcessBlock(Span<float> buffer)

Parameters

buffer Span<float>

Reset()

Clears internal state (delay lines, envelopes, smoothers) so the next block starts as if from silence.

public override void Reset()