Class CompressorEffect
Feed-forward dynamic-range compressor with a soft knee, peak or RMS detection, and attack/release ballistics. Detection is channel-linked (one gain for all channels) so the stereo image is preserved. Exposes the live gain reduction for metering.
public sealed class CompressorEffect : AudioEffect, IAudioEffect, IParameterized
- Inheritance
-
CompressorEffect
- Implements
- Inherited Members
Properties
AttackMs
Attack time in milliseconds. Default 10 ms.
public float AttackMs { get; set; }
Property Value
Detector
Level detector mode. Default Peak.
public DetectorMode Detector { get; set; }
Property Value
GainReductionDb
The most recent gain reduction in dB (≥ 0), for metering.
public float GainReductionDb { get; }
Property Value
KneeDb
Soft-knee width in dB (0 = hard knee). Default 6 dB.
public float KneeDb { get; set; }
Property Value
MakeUpGainDb
Make-up gain in dB applied after compression. Default 0 dB.
public float MakeUpGainDb { get; set; }
Property Value
Parameters
Generic parameter list (excludes Bypass/Mix, which are on the base).
public IReadOnlyList<EffectParameter> Parameters { get; }
Property Value
Ratio
Compression ratio (≥ 1). 4 means 4:1. Default 4.
public float Ratio { get; set; }
Property Value
ReleaseMs
Release time in milliseconds. Default 100 ms.
public float ReleaseMs { get; set; }
Property Value
RmsWindowMs
RMS averaging window in milliseconds (used when Detector is RMS). Default 10 ms.
public float RmsWindowMs { get; set; }
Property Value
ThresholdDb
Threshold in dBFS above which compression starts. Default -18 dB.
public float ThresholdDb { get; set; }
Property Value
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
formatWaveFormat
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
Reset()
Clears internal state (delay lines, envelopes, smoothers) so the next block starts as if from silence.
public override void Reset()