pub struct TelephoneEventDecoder {}Implementations§
Trait Implementations§
Source§impl Decoder for TelephoneEventDecoder
impl Decoder for TelephoneEventDecoder
Source§fn decode_into(
&mut self,
_data: &[u8],
_out: &mut [Sample],
) -> Result<usize, CodecError>
fn decode_into( &mut self, _data: &[u8], _out: &mut [Sample], ) -> Result<usize, CodecError>
Source§fn max_decode_samples(&self, _n_bytes: usize) -> usize
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
fn sample_rate(&self) -> u32
Get the sample rate of the decoded audio.
Source§fn enable_concealment(&mut self) -> bool
fn enable_concealment(&mut self) -> bool
Turn on the decoder’s own packet loss concealment, returning whether
Decoder::conceal_into will conceal. Off by default where keeping
it ready costs something on every decoded packet: G.711 and G.722
keep a history of the decoded audio, and have concealment only with
the plc feature. Opus’s and G.729’s are part of the decoder and
always on. The default returns false: no concealment.Source§fn conceal_into(
&mut self,
samples: usize,
out: &mut [Sample],
) -> Result<usize, CodecError>
fn conceal_into( &mut self, samples: usize, out: &mut [Sample], ) -> Result<usize, CodecError>
Conceal a lost packet: write
samples samples per channel of audio
to play in its place into out, returning the number written
(samples * channels). The decoder’s state carries on through the
loss as the codec allows, and the next packet decoded after it is
blended in. A long loss fades out: full level for 10 ms, silence at
60 ms (after G.711 Appendix I). Read moreSource§fn recover_into(
&mut self,
next: &[u8],
samples: usize,
out: &mut [Sample],
) -> Result<usize, CodecError>
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 moreSource§fn recover(&mut self, next: &[u8], samples: usize) -> PcmBuf
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.Auto Trait Implementations§
impl Freeze for TelephoneEventDecoder
impl RefUnwindSafe for TelephoneEventDecoder
impl Send for TelephoneEventDecoder
impl Sync for TelephoneEventDecoder
impl Unpin for TelephoneEventDecoder
impl UnsafeUnpin for TelephoneEventDecoder
impl UnwindSafe for TelephoneEventDecoder
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