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.
2 lines
308 B
Markdown
2 lines
308 B
Markdown
- 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`). `WebsocketSTTService` now provides opt-in silence-based keepalive via `keepalive_timeout` and `keepalive_interval` parameters.
|