#[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

Similar to Spec::sample_size but take a sample format instead of full sample spec.

Returns a descriptive string for the specified sample format.

Parse a sample format text. Inverse of to_string.

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.

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.

Is format native endian?

Returns true when the specified format is native endian, false when not. Returns None when endianness does not apply to the specified format, or endianness is unknown.

Is format reverse of native endian?

Returns true when the specified format is reverse endian, false when not. Returns None when endianness does not apply to the specified format, or endianness is unknown.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.