pub struct AudioJitterBuffer { /* private fields */ }Expand description
Adaptive jitter buffer for audio playback.
Implementations§
Source§impl AudioJitterBuffer
impl AudioJitterBuffer
Sourcepub fn new(config: JitterConfig) -> Self
pub fn new(config: JitterConfig) -> Self
Create a new jitter buffer with the given configuration.
Sourcepub fn state(&self) -> BufferState
pub fn state(&self) -> BufferState
Current buffer state.
Sourcepub fn underrun_count(&self) -> u64
pub fn underrun_count(&self) -> u64
Total underrun events since creation.
Sourcepub fn jitter_estimate_us(&self) -> f64
pub fn jitter_estimate_us(&self) -> f64
Current smoothed jitter estimate in microseconds.
Sourcepub fn push(&mut self, samples: &[i16])
pub fn push(&mut self, samples: &[i16])
Push audio samples into the buffer (called when network data arrives).
Sourcepub fn pull(&mut self, out: &mut [i16]) -> usize
pub fn pull(&mut self, out: &mut [i16]) -> usize
Pull audio samples for playback.
Fills out with audio data. If the buffer underruns, fills remaining
slots with silence (zero) for click-free output.
Returns the number of real (non-silence) samples written.
Auto Trait Implementations§
impl Freeze for AudioJitterBuffer
impl RefUnwindSafe for AudioJitterBuffer
impl Send for AudioJitterBuffer
impl Sync for AudioJitterBuffer
impl Unpin for AudioJitterBuffer
impl UnwindSafe for AudioJitterBuffer
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