pub struct DelayLine<T, const MAX_DELAY: usize>where
T: Transcendental,{ /* private fields */ }Expand description
Delay line for audio effects
Provides a circular buffer for implementing delay, reverb, and other time-based effects.
Implementations§
Source§impl<T, const MAX_DELAY: usize> DelayLine<T, MAX_DELAY>where
T: Transcendental,
impl<T, const MAX_DELAY: usize> DelayLine<T, MAX_DELAY>where
T: Transcendental,
Sourcepub fn set_delay_samples(&mut self, samples: usize)
pub fn set_delay_samples(&mut self, samples: usize)
Set delay in samples
Sourcepub fn delay_samples(&self) -> usize
pub fn delay_samples(&self) -> usize
Get current delay in samples
Sourcepub fn sample_rate(&self) -> f32
pub fn sample_rate(&self) -> f32
Get the current sample rate
Sourcepub fn read_delayed(&self, delay: usize) -> T
pub fn read_delayed(&self, delay: usize) -> T
Read sample at arbitrary delay (0 = most recent)
Sourcepub fn read_interpolated(&self, delay_frac: f32) -> T
pub fn read_interpolated(&self, delay_frac: f32) -> T
Read with linear interpolation between samples
Sourcepub fn write_position(&self) -> usize
pub fn write_position(&self) -> usize
Get current write position
Trait Implementations§
Source§impl<T, const MAX_DELAY: usize> Index<usize> for DelayLine<T, MAX_DELAY>where
T: Transcendental,
impl<T, const MAX_DELAY: usize> Index<usize> for DelayLine<T, MAX_DELAY>where
T: Transcendental,
Source§impl<T, const MAX_DELAY: usize> IndexMut<usize> for DelayLine<T, MAX_DELAY>where
T: Transcendental,
impl<T, const MAX_DELAY: usize> IndexMut<usize> for DelayLine<T, MAX_DELAY>where
T: Transcendental,
Source§impl<T, const MAX_DELAY: usize> SignalBuffer<T> for DelayLine<T, MAX_DELAY>where
T: Transcendental,
impl<T, const MAX_DELAY: usize> SignalBuffer<T> for DelayLine<T, MAX_DELAY>where
T: Transcendental,
Source§fn stats(&self) -> BufferStats
fn stats(&self) -> BufferStats
Get a snapshot of current buffer statistics
Source§fn reset_stats(&mut self)
fn reset_stats(&mut self)
Reset all statistics to zero Read more
Auto Trait Implementations§
impl<T, const MAX_DELAY: usize> !Freeze for DelayLine<T, MAX_DELAY>
impl<T, const MAX_DELAY: usize> !RefUnwindSafe for DelayLine<T, MAX_DELAY>
impl<T, const MAX_DELAY: usize> Send for DelayLine<T, MAX_DELAY>
impl<T, const MAX_DELAY: usize> Sync for DelayLine<T, MAX_DELAY>
impl<T, const MAX_DELAY: usize> Unpin for DelayLine<T, MAX_DELAY>where
T: Unpin,
impl<T, const MAX_DELAY: usize> UnsafeUnpin for DelayLine<T, MAX_DELAY>where
T: UnsafeUnpin,
impl<T, const MAX_DELAY: usize> UnwindSafe for DelayLine<T, MAX_DELAY>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more