pub struct Decoder { /* private fields */ }Expand description
Opus decoder producing interleaved f32 PCM.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new(catalog: &AudioConfig) -> Result<Self, AudioError>
pub fn new(catalog: &AudioConfig) -> Result<Self, AudioError>
Build a decoder from a catalog AudioConfig.
Parses the OpusHead description if present; falls back to the
catalog’s declared sample rate / channel count.
pub fn sample_rate(&self) -> u32
pub fn channel_count(&self) -> u32
Sourcepub fn decode_f32(&mut self, packet: &[u8]) -> Result<Vec<f32>, AudioError>
pub fn decode_f32(&mut self, packet: &[u8]) -> Result<Vec<f32>, AudioError>
Decode one packet into interleaved f32 PCM.
Trait Implementations§
Auto Trait Implementations§
impl !Sync for Decoder
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Unpin for Decoder
impl UnsafeUnpin for Decoder
impl UnwindSafe for Decoder
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