Replaces the per-frame asyncio.Event signaling with a monotonic timestamp updated on each audio frame. The handler sleeps until the next deadline (last_audio_time + timeout), recomputing on each wake-up to account for audio arriving during sleep. This avoids waking the handler on every audio frame (~50/s at 20ms chunks), and guarantees detection latency is bounded by timeout rather than 2 * timeout. Also renames audio_starvation_timeout to audio_idle_timeout and associated identifiers for consistency with existing pipecat naming (user_idle_timeout, etc.).
307 B
307 B
- Fixed
VADControllergetting stuck in theSPEAKINGstate when audio frames stop arriving mid-speech (e.g. user mutes mic). A newaudio_idle_timeoutparameter (default 1s, set to 0 to disable) forces a transition back toQUIETand emitson_speech_stoppedwhen no audio is received while speaking.