pub enum SampleFormat {
F32,
I32,
I24,
I16,
I8,
}
Expand description
Dynamic representation of audio data sample format.
Variants§
F32
32-bit float.
I32
32-bit signed integer.
I24
24-bit signed integer. Can be packed or not depending on the flags.
I16
16-bit signed integer.
I8
8-bit signed integer.
Implementations§
Source§impl SampleFormat
impl SampleFormat
Sourcepub fn does_match_flags(&self, flags: LinearPcmFlags) -> bool
pub fn does_match_flags(&self, flags: LinearPcmFlags) -> bool
Check if the format flags are appropriate for the given format.
Sourcepub fn from_flags_and_bits_per_sample(
flags: LinearPcmFlags,
bits_per_sample: u32,
) -> Option<Self>
pub fn from_flags_and_bits_per_sample( flags: LinearPcmFlags, bits_per_sample: u32, ) -> Option<Self>
Convert format flags and bits_per_sample to a SampleFormat.
Sourcepub fn size_in_bytes(&self) -> usize
pub fn size_in_bytes(&self) -> usize
Return the size of one sample in bytes, assuming that the format is packed.
Sourcepub fn size_in_bits(&self) -> u32
pub fn size_in_bits(&self) -> u32
Return the number of valid bits for one sample.
Trait Implementations§
Source§impl Clone for SampleFormat
impl Clone for SampleFormat
Source§fn clone(&self) -> SampleFormat
fn clone(&self) -> SampleFormat
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 moreSource§impl Debug for SampleFormat
impl Debug for SampleFormat
Source§impl PartialEq for SampleFormat
impl PartialEq for SampleFormat
impl Copy for SampleFormat
impl Eq for SampleFormat
impl StructuralPartialEq for SampleFormat
Auto Trait Implementations§
impl Freeze for SampleFormat
impl RefUnwindSafe for SampleFormat
impl Send for SampleFormat
impl Sync for SampleFormat
impl Unpin for SampleFormat
impl UnwindSafe for SampleFormat
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