pub struct InterpolatedReader<T> { /* private fields */ }Expand description
Heap-allocated buffer reader with fractional-position interpolation.
When wrap is true the position wraps modulo len (periodic / wavetable mode).
When wrap is false the position clamps at buffer boundaries (sample mode).
Implementations§
Source§impl<T: Transcendental + Copy> InterpolatedReader<T>
impl<T: Transcendental + Copy> InterpolatedReader<T>
pub fn new(buffer: Vec<T>) -> Self
pub fn from_boxed(buffer: Box<[T]>) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn position(&self) -> f64
pub fn set_position(&mut self, pos: f64)
pub fn rate(&self) -> f64
pub fn set_rate(&mut self, rate: f64)
pub fn is_cubic(&self) -> bool
pub fn set_cubic(&mut self, cubic: bool)
pub fn is_wrap(&self) -> bool
pub fn set_wrap(&mut self, wrap: bool)
pub fn set_buffer(&mut self, buffer: Vec<T>)
pub fn as_slice(&self) -> &[T]
Sourcepub fn render_block(&mut self, output: &mut [T])
pub fn render_block(&mut self, output: &mut [T])
Read the next block of samples, advancing self.position.
Auto Trait Implementations§
impl<T> Freeze for InterpolatedReader<T>
impl<T> RefUnwindSafe for InterpolatedReader<T>where
T: RefUnwindSafe,
impl<T> Send for InterpolatedReader<T>where
T: Send,
impl<T> Sync for InterpolatedReader<T>where
T: Sync,
impl<T> Unpin for InterpolatedReader<T>
impl<T> UnsafeUnpin for InterpolatedReader<T>
impl<T> UnwindSafe for InterpolatedReader<T>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