pub struct Encoder { /* private fields */ }Expand description
Encoder wrapper.
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn new(enable_vad: bool) -> Self
pub fn new(enable_vad: bool) -> Self
Create a new G.729 encoder.
enable_vad toggles Annex B (VAD/DTX).
Sourcepub fn encode_into(
&mut self,
input_80_samples: &[i16; 80],
out: &mut [u8; 10],
) -> u8
pub fn encode_into( &mut self, input_80_samples: &[i16; 80], out: &mut [u8; 10], ) -> u8
Encode one 80-sample frame into the caller-provided buffer.
Returns the number of bytes written to out (always <= VOICE_FRAME_BYTES).
This method is always available, including in no_std.
Sourcepub fn encode(&mut self, input_80_samples: &[i16; 80]) -> Vec<u8> ⓘ
pub fn encode(&mut self, input_80_samples: &[i16; 80]) -> Vec<u8> ⓘ
Encode one 80-sample frame into a fresh Vec<u8>.
Only available with the std feature (enabled by default).
pub fn rfc3389_payload(&mut self) -> [u8; 11]
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnsafeUnpin for Encoder
impl UnwindSafe for Encoder
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