pub struct AudioFormat {
pub bits_per_sample: u16,
pub channels: u16,
pub data_start: u64,
pub block_align: u16,
pub sample_format: SampleFormat,
}Expand description
PCM layout, as read from a container header.
Fields§
§bits_per_sample: u16§channels: u16§data_start: u64Byte offset in the file where sample data begins.
block_align: u16Bytes per frame: channels * bits_per_sample / 8.
sample_format: SampleFormatImplementations§
Source§impl AudioFormat
impl AudioFormat
Sourcepub fn sample_bytes(&self) -> usize
pub fn sample_bytes(&self) -> usize
Bytes per sample.
Sourcepub fn supported(&self) -> bool
pub fn supported(&self) -> bool
Is this something the codec models, rather than merely tolerates?
Every width WAV can hold: 8-bit unsigned, 16/24/32-bit signed, and 32-bit float. What each needs to reach the same signed-integer predictor differs, and is handled at the point the samples are read.
Trait Implementations§
Source§impl Clone for AudioFormat
impl Clone for AudioFormat
impl Copy for AudioFormat
Source§impl Debug for AudioFormat
impl Debug for AudioFormat
impl Eq for AudioFormat
Source§impl PartialEq for AudioFormat
impl PartialEq for AudioFormat
impl StructuralPartialEq for AudioFormat
Auto Trait Implementations§
impl Freeze for AudioFormat
impl RefUnwindSafe for AudioFormat
impl Send for AudioFormat
impl Sync for AudioFormat
impl Unpin for AudioFormat
impl UnsafeUnpin for AudioFormat
impl UnwindSafe for AudioFormat
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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