pub struct Decoder { /* private fields */ }
Expand description
An ALAC packet decoder.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new(config: StreamInfo) -> Decoder
pub fn new(config: StreamInfo) -> Decoder
Creates a Decoder
for a stream described by the StreamInfo
.
Sourcepub fn stream_info(&self) -> &StreamInfo
pub fn stream_info(&self) -> &StreamInfo
Returns the StreamInfo
used to create this decoder.
Sourcepub fn decode_packet<'a, S: Sample>(
&mut self,
packet: &[u8],
out: &'a mut [S],
) -> Result<&'a [S], InvalidData>
pub fn decode_packet<'a, S: Sample>( &mut self, packet: &[u8], out: &'a mut [S], ) -> Result<&'a [S], InvalidData>
Decodes an ALAC packet into out
.
Channels are interleaved, e.g. for a stereo packet out
would contains samples in the
order [left, right, left, right, ..]
.
Panics if out
is shorter than StreamInfo::max_samples_per_packet
.
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin 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