Skip to main content

compose_packet_code3

Function compose_packet_code3 

Source
pub fn compose_packet_code3(
    toc_byte: u8,
    frames: &[&[u8]],
    vbr: bool,
    padding: usize,
) -> Result<Vec<u8>, Error>
Expand description

Compose one code-3 Opus packet with explicit VBR / padding control (§3.2.5).

  • vbr — write the v bit and the M - 1 per-frame length sequences. With vbr == false (CBR) every frame must have the same length (R6).
  • padding — number of trailing padding bytes (zeros); the §3.2.5 255-chained padding-length header is derived from it and the p bit set when non-zero.

The TOC byte must carry frame-count code 3.