spawn_latency_filler

Function spawn_latency_filler 

Source
pub fn spawn_latency_filler(
    handle: &LiveHandle,
    speaker: Sender<Playback>,
    config: FillerConfig,
) -> JoinHandle<()>
Expand description

Keep the caller’s ear busy while the model is slow: when the caller stops speaking (LiveEvent::VadEnd) and no model audio arrives within config.delay, inject the configured clip into the connector’s playback channel. Model audio or an interruption disarms the timer; a Playback::Flush from a barge-in clears any queued filler exactly like any other queued audio.

Masking is not a substitute for reducing latency — it buys tolerance for the tail, and because it is driven by the same event stream as the telemetry lane, the silences it papers over remain visible in the latency metrics.

The task ends when the session’s event stream closes; abort the handle to stop it sooner.