Skip to main content

Crate zvidlib_opus_syntax

Crate zvidlib_opus_syntax 

Source
Expand description

Opus configuration records and packet timing, shared by zvidlib’s containers and its Opus codec.

Opus always decodes at 48 kHz, which is therefore the sample clock of every Opus track zvidlib reads or writes. OpusHead is the stream’s decoder configuration in both of the forms containers carry it, and opus_packet_samples reads a packet’s duration from its table-of-contents byte, which is all a container needs to time a packet without decoding it.

This is an internal crate of zvidlib, which re-exports its public items under the paths documented there. Depend on zvidlib rather than on this crate directly.

Structs§

OpusHead
The Opus identification header: the decoder configuration of an Opus stream (RFC 7845 section 5.1).

Constants§

OPUS_PREROLL_SAMPLES
How much audio to decode ahead of a seek target before its samples are trusted, 320 ms.
OPUS_SAMPLE_RATE
The sample rate Opus decodes at, and the sample clock of an Opus track.

Functions§

opus_packet_samples
The number of 48 kHz samples one Opus packet decodes to, read from its table-of-contents byte and frame count (RFC 6716 section 3.1).
opus_preroll_packets
The number of packets an crate::AudioSampleReader should decode ahead of a seek target in an Opus track whose packets are packets, enough to cover OPUS_PREROLL_SAMPLES even at the track’s shortest packet.