#[non_exhaustive]pub enum AudioFormat {
Show 16 variants
Aac,
Opus,
Mp2,
Ac3,
Mp3,
Speex,
Flac,
Vorbis,
PcmS16Le,
PcmF32Le,
PcmS24Le,
PcmS32Le,
PcmU8,
Mulaw,
Alaw,
ImaAdpcm,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Aac
Opus
Mp2
MPEG-1/2 Audio Layer II (mp2), the standard broadcast/DVB audio codec
(GStreamer audio/mpeg,mpegversion=1,layer=2). Encoded like Aac, so it
keeps a nominal channels/rate rather than the PCM wildcards; MPEG-TS carries
it under stream_type 0x03 (MPEG-1) / 0x04 (MPEG-2). Decoded via libavcodec.
Ac3
Dolby Digital / ATSC A/52 (ac3), the standard broadcast/DVD audio codec
(GStreamer audio/x-ac3). Self-syncing frames (0x0B77 sync + frame-size
code); MPEG-TS carries it under stream_type 0x81 (ATSC) or a private PES
(0x06) with an AC-3 descriptor (DVB), Matroska as A_AC3. Decoded via
libavcodec.
Mp3
MPEG-1/2/2.5 Audio Layer III (mp3), GStreamer
audio/mpeg,mpegversion=1,layer=3. Self-syncing frames like Mp2 (the
same 4-byte header, a Layer III frame length), the legacy FLV / RTMP audio
codec. Decoded via libavcodec.
Speex
Speex (RFC 5574), GStreamer audio/x-speex: the pre-Opus low-bitrate
speech codec, carried by FLV at a fixed 16 kHz mono. Container-framed (one
packet per FLV tag / Ogg packet). Carriage only, g2g registers no Speex
decoder, so an autoplugged decode chain fails to build rather than
pretending.
Flac
Free Lossless Audio Codec (flac), GStreamer audio/x-flac. Frame headers
are self-describing but not cheaply self-syncing, so g2g relies on the
container framing (one frame per Matroska block / Ogg packet); the STREAMINFO
header rides in-band as a leading fLaC frame the decoder takes as extradata.
Decoded via libavcodec.
Vorbis
Vorbis (GStreamer audio/x-vorbis), the Ogg / WebM audio codec that
preceded Opus. Encoded like Aac / Opus (nominal channels/rate, not
the PCM wildcards); container-framed (one packet per Ogg packet /
Matroska block), with the identification + setup headers riding in-band
ahead of the audio. Decoded in pure Rust (symphonia).
PcmS16Le
PcmF32Le
PcmS24Le
24-bit signed integer PCM, little-endian, 3 bytes packed (GStreamer S24LE).
The integer sibling of PcmF32Le for the ST 2110-30 / AES67 L24 wire: a
professional 24-bit source rides L24 without a detour through float.
PcmS32Le
32-bit signed integer PCM, little-endian (GStreamer S32LE). The native
container width of most modern DACs, so a 24-bit source reaches the
device without the 3-byte packing.
PcmU8
8-bit unsigned integer PCM, one byte per sample, silence at 0x80
(GStreamer U8). The legacy WAV / telephony sample width.
Mulaw
G.711 mu-law companded audio, one byte per sample (GStreamer
audio/x-mulaw, RTP payload type 0 / PCMU). Encoded, not raw PCM: like
Aac / Opus it keeps a nominal rate/channels rather than the PCM
wildcards. Codec in g2g-mcu::g711 (M638).
Alaw
G.711 A-law companded audio, one byte per sample (GStreamer
audio/x-alaw, RTP payload type 8 / PCMA). See AudioFormat::Mulaw.
ImaAdpcm
IMA ADPCM, 4 bits per sample in the WAV / DVI4 block layout
(GStreamer audio/x-adpcm layout=dvi). Encoded like the G.711 pair;
codec in g2g-mcu::adpcm (M639).
Trait Implementations§
Source§impl Clone for AudioFormat
impl Clone for AudioFormat
Source§fn clone(&self) -> AudioFormat
fn clone(&self) -> AudioFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more