Skip to Content

Signal sources

Live camera and recorded replay, and why the rest of the app cannot tell them apart.

A signal source produces samples. The rest of the app does not know where they came from.

LiveWebcamSDKmetrics eventsextract()The SDK also sends validation, errorsand the camera preview.Replayrecordings/guided.jsonlnumbers only, no videoreplaySourcereal time, loopsValidation is reported as OK once, at the start.SamplesonSamplebrowDetectorbrow: selectexhaleDetectorbreath, talk: speakOn-screen onlytraces, pulse
The recording stores samples that were already extracted, so replay skips the SDK and enters at the same point as live data. Everything to the right of that point runs the same code.
src/renderer/signals/source.ts
export type SignalSource = {
  readonly kind: 'live' | 'replay';
  start(ev: SourceEvents): Promise<void>;
  stop(): Promise<void>;
};

Samples

extract() reduces each raw SDK message to four kinds of sample:

kValueFrom
browBrow-to-eye distance ÷ eye spacingface.landmarks
breathChest position, plus a stable flagbreathing.upperTrace
talkBooleanface.talking
pulseBeats per minute, display onlycardio.pulseRate

Timestamps are microseconds since the epoch. Face and breathing samples arrive about 30 times a second.

Live

liveSource opens the camera, hands the stream to the SDK and turns each metrics event into samples.

It owns the camera stream rather than letting the SDK open it, to work around a camera bug.

Replay

replaySource plays recordings/guided.jsonl at real-time speed and loops. It lets you build without spending credits, and lets anyone try Glint with no camera or key.

On this page