AUDIO
Source snapshot · 12 October 2026

API reference / ravet_signal::DelayLine

Struct DelayLine 

pub struct DelayLine { /* private fields */ }
Expand description

A circular double-precision delay with linear fractional interpolation.

The cursor names the next write slot. Read before writing for a feedback delay; write before reading for a zero-delay feedforward path. Advance once after each sample. Delay zero reads the cursor slot, which contains the oldest sample until written. Finite delays clamp to 0..=length-1; nonfinite delays read zero without changing storage.

Implementations§

§

impl DelayLine

pub fn new(length: usize) -> Result<Self, EmptyDelay>

Allocate zeroed storage outside the processing callback.

pub fn read(&self, delay: f64) -> f64

pub fn read_integer(&self, delay: usize) -> f64

Read a whole-sample delay without fractional interpolation. Delays beyond storage clamp to length-1; zero reads the cursor slot.

pub fn write(&mut self, sample: f64)

pub fn advance(&mut self)

pub fn reset(&mut self)

Clear history and return the cursor to zero, retaining its allocation.

Trait Implementations§

§

impl Debug for DelayLine

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.