pub struct Drift { /* private fields */ }Expand description
Resamples interleaved frames from one clock to another close to it, by cubic interpolation between the input frames, at a ratio steered from the buffer’s fill after each of the device’s chunks.
Implementations§
Source§impl Drift
impl Drift
pub fn new(channels: u16, side: DeviceSide, nominal: f64) -> Self
Sourcepub fn device_ppm(&self) -> i32
pub fn device_ppm(&self) -> i32
How far the device’s clock runs from the stream’s, in parts per million, as the ratio follows it.
Sourcepub fn steer(&mut self, buffer: &FrameBuffer)
pub fn steer(&mut self, buffer: &FrameBuffer)
Steers the ratio from the fill after the device’s last chunk, once for each chunk: a fuller buffer than kept takes more input frames for each output frame, whichever side the device is on.
Sourcepub fn wanted(&self, frames: usize) -> usize
pub fn wanted(&self, frames: usize) -> usize
The input frames to add before frames output frames can be made.
pub fn push(&mut self, input: &[f32])
Auto Trait Implementations§
impl Forget for Drift
impl Freeze for Drift
impl Move for Drift
impl RefUnwindSafe for Drift
impl Send for Drift
impl Sync for Drift
impl Unpin for Drift
impl UnsafeUnpin for Drift
impl UnwindSafe for Drift
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