Struct kittyaudio::Resampler
source · pub struct Resampler { /* private fields */ }Expand description
Resamples audio from one sample rate to another.
Implementations§
source§impl Resampler
impl Resampler
sourcepub fn push_frame(&mut self, frame: Frame, frame_index: usize)
pub fn push_frame(&mut self, frame: Frame, frame_index: usize)
Push a new frame to the resampler.
sourcepub fn get(&self, fraction: f32) -> Frame
pub fn get(&self, fraction: f32) -> Frame
Get an interpolated frame from a resampler at a fractional value.
sourcepub const fn current_frame_index(&self) -> usize
pub const fn current_frame_index(&self) -> usize
Return the index of the frame in the source sound that is currently playing in the audio stream.
This is not the same as the most recently pushed frame, as the stream
mainly recieves an interpolated frame between self.frames[1] and
self.frames[2]. self.frames[0] and self.frames[3] are used for
the frame interpolation algorithm (see interpolate_frame).
sourcepub fn outputting_silence(&self) -> bool
pub fn outputting_silence(&self) -> bool
Return whether the resampler is outputting silence.
Trait Implementations§
source§impl PartialEq for Resampler
impl PartialEq for Resampler
impl Copy for Resampler
impl StructuralPartialEq for Resampler
Auto Trait Implementations§
impl RefUnwindSafe for Resampler
impl Send for Resampler
impl Sync for Resampler
impl Unpin for Resampler
impl UnwindSafe for Resampler
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