Skip to main content

Module vorbis

Module vorbis 

Source
Expand description

Vorbis decoder wrapping lewton (pure-Rust, MIT/Apache-2.0).

Vorbis storage in MKV / WebM doesn’t include the OGG container — MKV’s CodecPrivate carries the three Xiph setup headers (ident, comment, setup) packed in the Xiph “lacing” layout, then each Block holds one raw audio packet. Squad-23’s audio mux side will receive Vorbis sources from MKV demux this way; we accept the packed CodecPrivate as extra_data on construction and use lewton’s lower-level packet API.

For OGG-Vorbis files (.ogg / .oga) the MP4 mux side hands us whole audio packets the OGG demuxer split out — same code path, since lewton’s per-packet API is stateless across the container.

Xiph lacing layout (used by MKV CodecPrivate, FLAC METADATA_BLOCK, and several other places that need to pack 3 variable-length blobs into a flat byte buffer):

  • byte 0: number of headers minus one (so byte 0 = 2 for Vorbis)
  • bytes 1..N: lacing values for headers 0..N-2 (each: a sequence of 0xFF bytes terminated by a non-0xFF byte; the lengths sum)
  • then the headers in order (header 0, 1, …, N-1). The last header’s length is computed from the total CodecPrivate length minus the lacing prefix and the sum of explicit lacing lengths.

Structs§

VorbisDecoder