Adds opt-in keepalive_timeout and keepalive_interval params to WebsocketSTTService. When enabled, a background task sends silent audio (or a service-specific protocol message) when the connection has been idle, preventing server-side timeout disconnects. Subclasses override _send_keepalive(silence) to wrap the silence in their wire format. The default sends raw PCM bytes. Enables keepalive for ElevenLabs (10s), Gladia (20s), and Soniox (1s), replacing their per-service custom keepalive tasks.
308 B
308 B
- Fixed WebSocket STT services (ElevenLabs, Cartesia, Gladia, Soniox) disconnecting due to idle timeout when no audio is being sent (e.g. when inactive behind a
ServiceSwitcher).WebsocketSTTServicenow provides opt-in silence-based keepalive viakeepalive_timeoutandkeepalive_intervalparameters.