pub struct Encoder { /* private fields */ }Expand description
Encoder wrapper.
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn new(enable_vad: bool) -> Result<Self>
pub fn new(enable_vad: bool) -> Result<Self>
Create an encoder. Set enable_vad to true to enable VAD/DTX.
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 10ms frame of 80 PCM samples. Returns the produced payload bytes. With VAD, this may return 0 (no frame), 2 (SID), or 10 (voice) bytes.
Sourcepub fn rfc3389_payload(&mut self) -> [u8; 11]
pub fn rfc3389_payload(&mut self) -> [u8; 11]
If last frame was SID, get RFC3389 CN payload (11 bytes) for comfort noise.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl !Send for Encoder
impl !Sync for Encoder
impl Unpin 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