Expand description
Vorbis audio: decoder configuration, packet timing and native decoding.
A Vorbis stream is described by three header packets - identification,
comment and setup - which Matroska and WebM carry Xiph-laced as
CodecPrivate and a WebCodecs AudioDecoderConfig.description takes in
the same form. VorbisConfig parses and writes them, and reads from the
setup header the one thing a container does not record exactly: how many
samples each audio packet decodes to.
Decoding runs on Symphonia’s pure-Rust Vorbis decoder, and encoding on
zvidlib’s own port of the libvorbis encoder, so both work on every target
zvidlib builds for, wasm32 included.
Structs§
- Native
Vorbis Decoder - A native, pure-Rust Vorbis decoder for streams of one to eight channels,
producing interleaved
f32PCM in the Vorbis channel order (Vorbis I section 4.3.9). - Vorbis
Config - The three Vorbis I header packets and what zvidlib reads from them.
Constants§
- VORBIS_
PREROLL_ PACKETS - How many packets an
crate::AudioSampleReadermust decode ahead of the first one a request needs: a Vorbis packet’s samples are the overlap of its block with the previous packet’s, so the previous packet has to be decoded first.