#[non_exhaustive]pub enum CodecId {
WaveFormatTag(u16),
FourCc(FourCc),
Name(String),
}Expand description
How a container named the codec or sample format of its payload.
Containers identify codecs in incompatible ways, so this carries the
identity in the form it was read in rather than mapping it to a normalised
enum that would have to grow a variant for every codec the crate does not
support. A caller reading a DecodeError sees the
same value the file contained.
In WAV the codec identity and the sample-format identity are the same field
(wFormatTag: 1 is integer PCM, 3 is IEEE float, 6 is A-law, 7 is mu-law),
which is why one type serves both.
This enum is #[non_exhaustive]: consumers matching on it must include a
_ => catch-all arm so a future container’s identity scheme is not
source-breaking to add.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WaveFormatTag(u16)
A RIFF/WAVE wFormatTag, as read from the fmt chunk.
FourCc(FourCc)
A four-character code, as used by AIFF-C COMM compression types and
ISO base media sample entries.
Name(String)
A textual codec name, for containers that name codecs as strings.
Owned rather than borrowed because the whole point of reaching this variant is that the name came out of the file and is not one of a set the build knows.