pub struct OpusDecoder { /* private fields */ }Expand description
Opus decoder (SILK/CELT/hybrid, PLC, SILK in-band FEC), output rates 8/12/16/24/48 kHz, interleaved f32 PCM out.
Implementations§
Source§impl OpusDecoder
impl OpusDecoder
pub fn new(channels: u32, sample_rate: u32) -> Result<Self, &'static str>
Sourcepub fn decode(&mut self, packet: &[u8]) -> Result<Vec<f32>, &'static str>
pub fn decode(&mut self, packet: &[u8]) -> Result<Vec<f32>, &'static str>
Decode one packet to interleaved f32 PCM.
Sourcepub fn decode_lost(
&mut self,
frame_size: usize,
next_packet: Option<&[u8]>,
) -> Result<Vec<f32>, &'static str>
pub fn decode_lost( &mut self, frame_size: usize, next_packet: Option<&[u8]>, ) -> Result<Vec<f32>, &'static str>
Conceal a LOST packet of frame_size samples per channel;
next_packet (the one after the loss) supplies SILK in-band FEC
when present.
pub fn final_range(&self) -> u32
Trait Implementations§
Source§impl Drop for OpusDecoder
impl Drop for OpusDecoder
impl Send for OpusDecoder
Auto Trait Implementations§
impl !Sync for OpusDecoder
impl Freeze for OpusDecoder
impl RefUnwindSafe for OpusDecoder
impl Unpin for OpusDecoder
impl UnsafeUnpin for OpusDecoder
impl UnwindSafe for OpusDecoder
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