Add silence-based keepalive to WebsocketSTTService
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.
This commit is contained in:
1
changelog/3675.fixed.md
Normal file
1
changelog/3675.fixed.md
Normal file
@@ -0,0 +1 @@
|
||||
- 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.
|
||||
Reference in New Issue
Block a user