Streaming Multimodal Interaction › The Streaming Pipeline
Language AI HandbookAll chapters Capture produces timestamped chunks. A media front end may combine microphone frames, a running transcript and detections from video. The controller then commits to an action, such as waiting, starting a response, or invalidating part of the output queue. The model and renderer run on possibly different timing boundaries.
A useful trace includes the event timestamp, the clock used to measure it, the turn or generation it belongs to, and whether it denotes observation, computation, schedule or actual playback. These distinctions matter when a user stops speaking on a client clock and the server later receives the corresponding frame. An arrival timestamp includes transport and queue delay. An event time describes when the underlying observation occurred, within the accuracy of the measurement.
Chunking and the Ring Buffer
A ring buffer retains a bounded recent window. When a detector confirms speech after it begins, the buffer can supply earlier samples to the recognizer if that span is still present. Longer retention increases memory and, for sensitive input, the data that may be accessible. Smaller chunks can reduce accumulation delay at a fixed sample rate. The best operating point depends on scheduling overhead, the encoder and any lookahead.
A simple buffer calculation connects chunking to implementation. For mono PCM at 16,000 samples per second and two bytes per sample, 320 ms represents 5,120 samples, or 10,240 raw bytes. At a 20 ms hop, that is 16 hops. An implementation needs room for the corresponding audio plus any metadata, indices and copies handed downstream. With multiple channels supplied at the same per-channel rate, multiply the payload by the number of channels.
Consider a recognizer that needs 100 ms of pre-roll and a detector that waits an additional 60 ms before committing. The needed 160 ms span must still be present when the recognizer reads it. Measure the age of the oldest captured frame at dispatch. The difference between nominal and effective retention can grow under load when frame production outruns a stalled consumer.
When observations consistently arrive faster than they can be processed, an unbounded first-in, first-out queue leaves newer observations waiting progressively longer. A bounded queue needs a policy for dropping frames and state. A system might preserve the audio needed to finish the current turn while retaining only the latest frame used to query a live display. Test this on a short interruption after a queue stall. The trace should reveal whether the system acted on a newly arrived packet carrying an older observation or on new captured data.
Voice Activity and Endpointing
Voice activity marks evidence of speech in individual frames. Endpointing decides whether enough evidence exists to commit to the end of the turn. A pause can occur inside a turn. A backchannel can overlap the assistant without requesting a stop. Jitter and detector delays also change when a boundary is noticed. Record the annotation rule for real turn ends when using them as an evaluation reference.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!