Skip to main content

tone

Function tone 

Source
pub fn tone(
    digit: Digit,
    packets: usize,
    samples_per_packet: u16,
) -> Vec<TonePacket>
Expand description

Build the packets for one keypress.

Every packet of a segment shares one RTP timestamp — the segment’s start — which is what marks them as one tone. The duration grows across the run, and the last packet is repeated with the end bit set. An event too long for the duration field continues as a new segment (RFC 4733 §2.5.1.3): the duration restarts, the offset advances, and only the final segment carries the end bit.