Skip to main content

G729Decoder

Struct G729Decoder 

Source
pub struct G729Decoder { /* private fields */ }
Expand description

G.729 audio decoder using g729-sys

Implementations§

Source§

impl G729Decoder

Source

pub fn new() -> Self

Create a new G.729 decoder instance.

Trait Implementations§

Source§

impl Decoder for G729Decoder

Source§

fn enable_concealment(&mut self) -> bool

G.729’s concealment is part of the decoder: always on.

Source§

fn conceal_into( &mut self, samples: usize, out: &mut [Sample], ) -> Result<usize, CodecError>

Conceals with G.729’s frame erasure concealment (§4.4): the last spectral envelope and pitch carry on with their gains attenuated, the decoder’s predictors kept in step, so the packets after the loss decode close to what the sender encoded. In DTX, after a SID frame, it carries on the comfort noise instead (Annex B). Faded through a long loss like the other codecs: full level for 10 ms, silence at 60 ms. samples must be a multiple of 80 (10 ms); others fail with InvalidInput.

Source§

fn decode_into( &mut self, data: &[u8], out: &mut [Sample], ) -> Result<usize, CodecError>

Decode data into out, returning the number of samples written. Read more
Source§

fn max_decode_samples(&self, n_bytes: usize) -> usize

Upper bound on the number of samples that decode_into will write for an input of n_bytes bytes.
Source§

fn sample_rate(&self) -> u32

Get the sample rate of the decoded audio.
Source§

fn channels(&self) -> u16

Get the number of channels.
Source§

fn recover_into( &mut self, next: &[u8], samples: usize, out: &mut [Sample], ) -> Result<usize, CodecError>

Rebuild a lost packet from next, the packet that followed it, when the codec carries redundancy for it (Opus in-band FEC), into out like Decoder::conceal_into. next is not consumed: decode it with decode_into afterwards. Read more
Source§

fn recover(&mut self, next: &[u8], samples: usize) -> PcmBuf

Convenience wrapper that allocates a Vec and calls recover_into. Empty when the decoder can neither recover nor conceal.
Source§

fn conceal(&mut self, samples: usize) -> PcmBuf

Convenience wrapper that allocates a Vec and calls conceal_into. Empty when the decoder has no concealment of its own.
Source§

fn decode(&mut self, data: &[u8]) -> PcmBuf

Convenience wrapper that allocates a Vec and calls decode_into.
Source§

impl Default for G729Decoder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Send for G729Decoder

Source§

impl Sync for G729Decoder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.