Table of Contents

Class GainEffect

Namespace
NAudio.Effects
Assembly
NAudio.Core.dll

Applies a gain (volume) to the signal, expressed in decibels or as a linear multiplier. Gain changes are smoothed so automating the level never clicks.

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

Properties

GainDb

Gain in decibels (0 dB = unity). Setting this updates LinearGain.

public float GainDb { get; set; }

Property Value

float

LinearGain

Linear gain multiplier (1 = unity). Setting this updates GainDb.

public float LinearGain { get; set; }

Property Value

float

Parameters

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

public IReadOnlyList<EffectParameter> Parameters { get; }

Property Value

IReadOnlyList<EffectParameter>

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()