pub struct PcmDecoder { /* private fields */ }Expand description
Decodes raw PCM bytes to an AudioFrame.
No header parsing is performed — the caller must know the format ahead of time.
Implementations§
Source§impl PcmDecoder
impl PcmDecoder
Sourcepub fn decode_bytes(&self, bytes: &[u8]) -> CodecResult<AudioFrame>
pub fn decode_bytes(&self, bytes: &[u8]) -> CodecResult<AudioFrame>
Decode raw PCM bytes into an AudioFrame.
Samples are decoded to normalised f32 and stored as F32-LE bytes in
the returned AudioFrame.
§Errors
Returns CodecError::InvalidBitstream if bytes.len() is not an
exact multiple of bytes-per-sample.
Sourcepub fn frame_count(&self, bytes: &[u8]) -> usize
pub fn frame_count(&self, bytes: &[u8]) -> usize
Compute the number of frames (per-channel sample groups) in a byte slice.
Trait Implementations§
Source§impl Clone for PcmDecoder
impl Clone for PcmDecoder
Source§fn clone(&self) -> PcmDecoder
fn clone(&self) -> PcmDecoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PcmDecoder
impl RefUnwindSafe for PcmDecoder
impl Send for PcmDecoder
impl Sync for PcmDecoder
impl Unpin for PcmDecoder
impl UnsafeUnpin for PcmDecoder
impl UnwindSafe for PcmDecoder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more