Skip to main content

max_audio_payload

Function max_audio_payload 

Source
pub fn max_audio_payload(max_plaintext: usize) -> usize
Expand description

Largest encoded-audio payload that fits one frame without fragmentation.

An audio chunk spends one byte on its message id, eight on the timestamp and four on send_ahead, so the payload gets whatever max_plaintext has left. A value below that fixed header, which makes any chunk impossible, yields 0.