#[non_exhaustive]pub enum SampleFormat {
Int16,
Int24,
Int32,
Float32,
}Expand description
The sample type and width of a linear-PCM stream.
Covers the sample formats an AudioServerPlugin realistically
negotiates. Anything outside this set is still representable as a
raw StreamFormat via StreamFormat::from_raw, but the
typed constructors and StreamFormat::sample_format only know
these.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Int16
16-bit signed integer samples.
Int24
24-bit signed integer samples packed into 3-byte words.
Int32
32-bit signed integer samples.
Float32
32-bit IEEE float samples — the canonical interchange format.
Implementations§
Source§impl SampleFormat
impl SampleFormat
Sourcepub const fn bits_per_channel(self) -> u32
pub const fn bits_per_channel(self) -> u32
Bits per individual sample (one channel of one frame).
Sourcepub const fn bytes_per_channel(self) -> u32
pub const fn bytes_per_channel(self) -> u32
Bytes occupied by one sample in a packed stream.
Sourcepub const fn format_flags(self) -> u32
pub const fn format_flags(self) -> u32
The kAudioFormatFlag* bits this sample format implies for a
packed, interleaved, native-endian stream.
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 (const: unstable) · 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 Hash for SampleFormat
impl Hash for SampleFormat
Source§impl PartialEq for SampleFormat
impl PartialEq for SampleFormat
Source§fn eq(&self, other: &SampleFormat) -> bool
fn eq(&self, other: &SampleFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.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 UnsafeUnpin 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