Skip to main content

Module calls

Module calls 

Source
Expand description

Calls: the platform-free half from vector-calls, and with calls the session itself. Calls. The platform-free half (wire format, jitter buffer, rate control) is the vector-calls crate, re-exported here; with the calls feature, the session and its video track run here too, over whatever a client plugs into [platform].

Modules§

declick
Removes the click a microphone makes when its cable is pulled or pushed in: a sample-to-sample slam that speech never produces, followed by a short offset tail. Runs a couple of milliseconds behind the input so the samples just before the slam can go too.
jitter
The adaptive jitter buffer: holds a few frames so the network’s unevenness is smoothed out before the decoder, grows on late arrivals, and takes the latency back when the path settles. Time comes in as milliseconds from the caller.
link
The link between the media engine and whatever captures, encodes, decodes and paints video (a webview over a loopback socket, or an in-process port). Binary messages, the first byte says what follows.
rate
Bitrate control for the encoder, fed by QUIC’s own loss accounting: every datagram rides in a packet the peer acknowledges, so the sender learns what went missing without a report channel. A lossy link steps the ladder down at once; a clean one climbs back a rung at a time.
resample
A streaming linear resampler: carries its phase and last sample across blocks so a live stream has no seam where one block ends and the next begins.
ring
A single-producer, single-consumer sample ring the audio callbacks can touch: no lock, no allocation, a dropped sample on overflow rather than a stall.
share
A shared screen’s sound on its way to the engine: interleaved samples at the capture’s own rate. Lives on the call, not the engine, so a device change does not lose what was in flight.
stats
The counters one call keeps for its whole life, shared by the media threads, the liveness check and the stats line. Atomics so no thread waits on another.
wire
The call’s wire format over one Iroh connection: a reliable control stream for the few messages that must arrive, unreliable QUIC datagrams for audio, where a late frame is worth less than nothing, and one unidirectional QUIC stream per video frame, so a keyframe always lands whole and a stale delta can be reset.

Constants§

AEC_TAIL_MS
How late the echo may arrive after its far-end reference: device buffers plus room.
ENGINE_RATE
Fullband: what the devices run at, so the microphone and speaker paths usually need no resampling, and Opus keeps everything the microphone heard.
FRAME
FRAME_MS