Expand description
Minimal pure-Rust RIFF/WAVE container.
Supports reading and writing linear PCM streams via the pcm_* codecs
(pcm_u8, pcm_s16le, pcm_s24le, pcm_s32le, pcm_f32le,
pcm_f64le) and dispatches WAVE_FORMAT_ALAW (0x0006) /
WAVE_FORMAT_MULAW (0x0007) streams to the external pcm_alaw /
pcm_mulaw codecs (provided by oxideav-g711, applied at decode
time by the host runtime — this crate’s WAV layer only handles
framing).
§WAVEFORMATEXTENSIBLE (wFormatTag = 0xFFFE)
Per docs/container/riff/waveformatextensible/README.md the demuxer
parses the 22-byte extension and surfaces:
wValidBitsPerSample— actual bit precision (may differ from thewBitsPerSamplecontainer size for 24-in-32-bit PCM).dwChannelMask—SPEAKER_*bitmap describing the channel ordering of the interleaved PCM byte stream.SubFormatGUID — the codec identifier when the legacywFormatTagis the EXTENSIBLE escape hatch.
Well-known KSDATAFORMAT_SUBTYPE_* GUIDs (PCM, IEEE_FLOAT, ALAW,
MULAW) are mapped to the same codec ids the legacy
WAVEFORMATEX path would have produced. Unknown GUIDs synthesise a
wav:guid_<canonical-text> codec id so downstream
CodecRegistry::make_decoder lookups fail cleanly naming the
actual GUID.
The extension fields are also exposed verbatim through
Demuxer::metadata under the keys
wav:fmt.valid_bits_per_sample / wav:fmt.channel_mask /
wav:fmt.subformat (matching the round-75 oxideav-avi shape, but
single-stream so no per-stream index).
Structs§
- WavDemuxer
- WAV demuxer.
- WavMux
Options - Optional muxer configuration: write a
WAVE_FORMAT_EXTENSIBLE(wFormatTag = 0xFFFE) header with the supplieddwChannelMask,wValidBitsPerSample, and SubFormat GUID. Seedocs/container/riff/waveformatextensible/README.md§“Channel-mask” for the standard layouts.
Constants§
- WAVE_
FORMAT_ ALAW WAVE_FORMAT_ALAW— ITU-T G.711 A-law (RFC 2361 A.7).- WAVE_
FORMAT_ EXTENSIBLE WAVE_FORMAT_EXTENSIBLE— escape hatch with 22-byte extension carryingwValidBitsPerSample/dwChannelMask/SubFormatGUID (per docs/container/riff/waveformatextensible/README.md).- WAVE_
FORMAT_ IEEE_ FLOAT WAVE_FORMAT_IEEE_FLOAT— 32-bit / 64-bit IEEE 754 float PCM.- WAVE_
FORMAT_ MULAW WAVE_FORMAT_MULAW— ITU-T G.711 μ-law (RFC 2361 A.8).- WAVE_
FORMAT_ PCM WAVE_FORMAT_PCM— integer linear PCM (mmreg.h).
Functions§
- open_
muxer_ with - Open the WAV muxer with caller-controlled
WAVEFORMATEXTENSIBLEoptions. Identical toopen_muxerwhenopts == WavMuxOptions::default(). - register