pub struct Decoder { /* private fields */ }Expand description
Decodes codec packets into interleaved f32 PCM.
The bring-your-own-payload layer under Consumer: use it
when the packets don’t come from a plain track subscription.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new(catalog: &AudioConfig) -> Result<Self, Error>
pub fn new(catalog: &AudioConfig) -> Result<Self, Error>
Build a decoder from a catalog AudioConfig.
Parses the OpusHead description if present; falls back to the catalog’s
declared sample rate / channel count. PCM uses those catalog fields
directly and requires an absent description.
Sourcepub fn sample_rate(&self) -> u32
pub fn sample_rate(&self) -> u32
The rate the codec decodes at, read from the catalog.
Sourcepub fn channel_count(&self) -> u32
pub fn channel_count(&self) -> u32
The channel count the codec decodes at, read from the catalog.
Auto Trait Implementations§
impl !Sync for Decoder
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send 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