pub struct StreamingEncoder { /* private fields */ }Implementations§
Source§impl StreamingEncoder
impl StreamingEncoder
Sourcepub fn new(sample_rate: u32, channels: u8, bit_depth: u8) -> Self
pub fn new(sample_rate: u32, channels: u8, bit_depth: u8) -> Self
Create a new streaming encoder
Sourcepub fn with_compression(self, level: u8) -> Self
pub fn with_compression(self, level: u8) -> Self
Set compression level (0-9)
Sourcepub fn pending_samples(&self) -> usize
pub fn pending_samples(&self) -> usize
Get number of pending samples in buffer
Sourcepub fn pending_frames(&self) -> usize
pub fn pending_frames(&self) -> usize
Get number of encoded frames ready
Sourcepub fn push_samples(&mut self, samples: &[f32]) -> FloResult<()>
pub fn push_samples(&mut self, samples: &[f32]) -> FloResult<()>
Push samples to the encoder
Samples should be interleaved if multi-channel
Sourcepub fn next_frame(&mut self) -> Option<EncodedFrame>
pub fn next_frame(&mut self) -> Option<EncodedFrame>
Get next encoded frame if available
Sourcepub fn flush(&mut self) -> FloResult<Option<EncodedFrame>>
pub fn flush(&mut self) -> FloResult<Option<EncodedFrame>>
Flush remaining samples (may produce a partial frame)
Auto Trait Implementations§
impl Freeze for StreamingEncoder
impl RefUnwindSafe for StreamingEncoder
impl Send for StreamingEncoder
impl Sync for StreamingEncoder
impl Unpin for StreamingEncoder
impl UnwindSafe for StreamingEncoder
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