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.channel_layout / wav:fmt.subformat (matching the
round-75 oxideav-avi shape, but single-stream so no per-stream
index). wav:fmt.channel_layout is the dwChannelMask bitmap
decoded into a +-separated list of SPEAKER_* positions per
docs/container/riff/waveformatextensible/ms-waveformatextensible.html.
Structs§
- Acid
Chunk - Typed view of the Acidizer
acidchunk body (loop/tempo metadata written by loop-authoring tools). Field offsets and flag-bit semantics perdocs/container/riff/metadata/exiftool-riff-tags.html§ “RIFF Acidizer Tags” (byte-indexed table: flags at 0, root note at 4, beats at 12, meter at 16, tempo at 20): - 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§
- ACID_
FLAG_ DISK_ BASED AcidChunk::flagsbit 3 — disk-based (streamed) rather than RAM-resident.- ACID_
FLAG_ HIGH_ OCTAVE AcidChunk::flagsbit 4 — high-octave root-note interpretation.- ACID_
FLAG_ ONE_ SHOT AcidChunk::flagsbit 0 — the clip is a one-shot (played once, not tempo-stretched as a loop).- ACID_
FLAG_ ROOT_ NOTE_ SET AcidChunk::flagsbit 1 —root_notecarries a meaningful value.- ACID_
FLAG_ STRETCH AcidChunk::flagsbit 2 — time-stretch enabled.- 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(). - open_
wav_ demuxer - Open a WAV/RF64/BW64 demuxer returning the concrete
WavDemuxerso the typed accessor surface (WavDemuxer::format_tag,WavDemuxer::channel_mask,WavDemuxer::acid, …) is reachable without downcasting. The registry path wraps this in aBox<dyn Demuxer>. - register