Skip to main content

Crate zvidlib_vorbis_decoder

Crate zvidlib_vorbis_decoder 

Source
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§

NativeVorbisDecoder
A native, pure-Rust Vorbis decoder for streams of one to eight channels, producing interleaved f32 PCM in the Vorbis channel order (Vorbis I section 4.3.9).
VorbisConfig
The three Vorbis I header packets and what zvidlib reads from them.

Constants§

VORBIS_PREROLL_PACKETS
How many packets an crate::AudioSampleReader must 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.