#[non_exhaustive]#[repr(i32)]pub enum Format {
Show 48 variants
Unknown = -1,
S8 = 0,
U8 = 1,
S16LE = 2,
S16BE = 3,
U16LE = 4,
U16BE = 5,
S24LE = 6,
S24BE = 7,
U24LE = 8,
U24BE = 9,
S32LE = 10,
S32BE = 11,
U32LE = 12,
U32BE = 13,
FloatLE = 14,
FloatBE = 15,
Float64LE = 16,
Float64BE = 17,
IEC958SubframeLE = 18,
IEC958SubframeBE = 19,
MuLaw = 20,
ALaw = 21,
ImaAdPCM = 22,
MPEG = 23,
GSM = 24,
Special = 31,
S243LE = 32,
S243BE = 33,
U243LE = 34,
U243BE = 35,
S203LE = 36,
S203BE = 37,
U203LE = 38,
U203BE = 39,
S183LE = 40,
S183BE = 41,
U183LE = 42,
U183BE = 43,
G72324 = 44,
G723241B = 45,
G72340 = 46,
G723401B = 47,
DSDU8 = 48,
DSDU16LE = 49,
DSDU32LE = 50,
DSDU16BE = 51,
DSDU32BE = 52,
}Available on crate feature
alsa only.Expand description
Defines the supported format of a stream.
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.
Unknown = -1
S8 = 0
U8 = 1
S16LE = 2
S16BE = 3
U16LE = 4
U16BE = 5
S24LE = 6
S24BE = 7
U24LE = 8
U24BE = 9
S32LE = 10
S32BE = 11
U32LE = 12
U32BE = 13
FloatLE = 14
FloatBE = 15
Float64LE = 16
Float64BE = 17
IEC958SubframeLE = 18
IEC958SubframeBE = 19
MuLaw = 20
ALaw = 21
ImaAdPCM = 22
MPEG = 23
GSM = 24
Special = 31
S243LE = 32
S243BE = 33
U243LE = 34
U243BE = 35
S203LE = 36
S203BE = 37
U203LE = 38
U203BE = 39
S183LE = 40
S183BE = 41
U183LE = 42
U183BE = 43
G72324 = 44
G723241B = 45
G72340 = 46
G723401B = 47
DSDU8 = 48
DSDU16LE = 49
DSDU32LE = 50
DSDU16BE = 51
DSDU32BE = 52
Implementations§
Source§impl Format
impl Format
Sourcepub fn from_value(value: i32) -> Option<Self>
pub fn from_value(value: i32) -> Option<Self>
Parse the given enum from a value.
Source§impl Format
impl Format
Sourcepub fn physical_width(self) -> Result<usize>
pub fn physical_width(self) -> Result<usize>
Return bits needed to store a PCM sample.
§Examples
use audio_device::alsa;
assert_eq!(alsa::Format::U8.physical_width()?, 8);
assert_eq!(alsa::Format::S16LE.physical_width()?, 16);
assert_eq!(alsa::Format::S243LE.physical_width()?, 24);Trait Implementations§
Source§impl Ord for Format
impl Ord for Format
Source§impl PartialOrd for Format
impl PartialOrd for Format
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnwindSafe for Format
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