Enum libpulse_binding::sample::Format
source · #[repr(C)]
pub enum Format {
Show 14 variants
U8,
ALaw,
ULaw,
S16le,
S16be,
F32le,
F32be,
S32le,
S32be,
S24le,
S24be,
S24_32le,
S24_32be,
Invalid,
}Expand description
Sample format
Variants
U8
Unsigned 8 Bit PCM.
ALaw
8 Bit a-Law.
ULaw
8 Bit mu-Law.
S16le
Signed 16 Bit PCM, little endian (PC).
S16be
Signed 16 Bit PCM, big endian.
F32le
32 Bit IEEE floating point, little endian (PC), range -1.0 to 1.0.
F32be
32 Bit IEEE floating point, big endian, range -1.0 to 1.0.
S32le
Signed 32 Bit PCM, little endian (PC).
S32be
Signed 32 Bit PCM, big endian.
S24le
Signed 24 Bit PCM packed, little endian (PC).
S24be
Signed 24 Bit PCM packed, big endian.
S24_32le
Signed 24 Bit PCM in LSB of 32 Bit words, little endian (PC).
S24_32be
Signed 24 Bit PCM in LSB of 32 Bit words, big endian.
Invalid
An invalid value.
Implementations
sourceimpl Format
impl Format
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Similar to Spec::sample_size but take a sample
format instead of full sample spec.
sourcepub fn to_string(&self) -> Option<Cow<'static, str>>
pub fn to_string(&self) -> Option<Cow<'static, str>>
Returns a descriptive string for the specified sample format.
sourcepub fn is_le(&self) -> Option<bool>
pub fn is_le(&self) -> Option<bool>
Returns true when the specified format is little endian, false if big endian. Returns
None when endianness does not apply to this format, or if unknown.
sourcepub fn is_be(&self) -> Option<bool>
pub fn is_be(&self) -> Option<bool>
Returns true when the specified format is big endian, false if little endian. Returns
None when endianness does not apply to this format, or if unknown.