Table of Contents

Class DelayLine

Namespace
NAudio.Dsp
Assembly
NAudio.Core.dll

A single-channel circular delay line with integer and fractional (linearly interpolated) taps. The building block for delay, chorus, flanger and reverb effects. Writes are denormal-flushed so a decaying feedback tail cannot stall the CPU on subnormal arithmetic.

public sealed class DelayLine
Inheritance
DelayLine
Inherited Members

Constructors

DelayLine(int)

Creates a delay line able to produce up to maxDelaySamples samples of delay.

public DelayLine(int maxDelaySamples)

Parameters

maxDelaySamples int

Maximum delay in samples. Must be at least 1.

Properties

MaxDelaySamples

Maximum delay in samples this line can produce.

public int MaxDelaySamples { get; }

Property Value

int

Methods

Read(int)

Reads the sample delaySamples samples in the past (1 = most recently written).

public float Read(int delaySamples)

Parameters

delaySamples int

Delay in samples, from 1 to MaxDelaySamples.

Returns

float

Read(float)

Reads a fractional delay using linear interpolation between the two neighbouring samples.

public float Read(float delaySamples)

Parameters

delaySamples float

Delay in samples (may be fractional), from 1 to MaxDelaySamples.

Returns

float

Reset()

Clears the delay line.

public void Reset()

Write(float)

Writes one sample into the line, advancing the write head.

public void Write(float sample)

Parameters

sample float