pub struct Upsampler { /* private fields */ }Expand description
Causal, zero-padded interpolation. State size depends only on the filter.
Implementations§
Source§impl Upsampler
impl Upsampler
Sourcepub fn new(factor: u32, base_rate_hz: u32) -> Result<Self, Error>
pub fn new(factor: u32, base_rate_hz: u32) -> Result<Self, Error>
Accepts factors 4, 8, or 16 and any base rate supported by the crate.
Invalid factors return Error::InvalidConfig; invalid rates return Error::InvalidInput.
Sourcepub fn process(
&mut self,
input: &[f32],
output: &mut Vec<f32>,
) -> Result<(), Error>
pub fn process( &mut self, input: &[f32], output: &mut Vec<f32>, ) -> Result<(), Error>
Appends exactly input.len() * factor samples, retaining the causal delay.
An invalid block leaves both state and output unchanged. After flush, reset first.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Upsampler
impl RefUnwindSafe for Upsampler
impl Send for Upsampler
impl Sync for Upsampler
impl Unpin for Upsampler
impl UnsafeUnpin for Upsampler
impl UnwindSafe for Upsampler
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