Table of Contents

Class DelayEffect

Namespace
NAudio.Effects
Assembly
NAudio.Core.dll

Feedback delay / echo with optional tempo sync, feedback damping and ping-pong. The delay time can be set directly in milliseconds or locked to a tempo and note division. A one-pole damping filter in the feedback path darkens successive repeats. In ping-pong mode (stereo) the echoes bounce between channels.

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

Constructors

DelayEffect()

Creates a delay with a sensible default wet/dry mix.

public DelayEffect()

Properties

Damping

Feedback-path damping, 0 (bright) to 1 (dark). Default 0.

public float Damping { get; set; }

Property Value

float

DelayMs

Delay time in milliseconds (used when TempoSync is false). Default 350 ms.

public float DelayMs { get; set; }

Property Value

float

Division

Note division, used when TempoSync is true. Default quarter note.

public NoteDivision Division { get; set; }

Property Value

NoteDivision

EffectiveDelayMs

The delay time actually in effect, in milliseconds — the tempo-derived time when TempoSync is on, otherwise DelayMs. Read-only; useful for showing what a chosen tempo/division resolves to.

public float EffectiveDelayMs { get; }

Property Value

float

Feedback

Feedback amount, 0 to < 1. Default 0.4.

public float Feedback { 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>

PingPong

When true (and stereo), echoes alternate between left and right.

public bool PingPong { get; set; }

Property Value

bool

Tempo

Tempo in BPM, used when TempoSync is true. Default 120.

public double Tempo { get; set; }

Property Value

double

TempoSync

When true the delay time follows Tempo and Division.

public bool TempoSync { 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()