Summary
Add mute() and unmute() convenience methods to the streaming WebSocket clients (ListenWebSocketClient and AsyncListenWebSocketClient) that pause audio transmission while keeping the connection alive, without requiring developers to manually manage KeepAlive timers.
Problem it solves
Developers building voice applications frequently need to pause transcription (e.g., when the user clicks a mute button, during hold music, or when switching audio sources) without tearing down and re-establishing the WebSocket connection. Currently, implementing mute requires manually stopping audio sends and managing KeepAlive messages to prevent connection timeout — a pattern that's error-prone and requires understanding Deepgram's connection lifecycle. A simple mute()/unmute() API reduces this to one line of code and handles the KeepAlive internally.
Proposed API
# Sync client
client = deepgram.listen.websocket.v("1")
client.start(options)
# Send audio normally
client.send(audio_data)
# Mute — stops accepting audio, automatically sends KeepAlive
client.mute()
# Audio sent during mute is silently discarded
client.send(audio_data) # no-op while muted
# Unmute — resumes audio transmission, stops KeepAlive timer
client.unmute()
client.send(audio_data) # transcribed normally
# Check mute state
if client.is_muted:
print("Currently muted")
# Async client — same API
await async_client.mute()
await async_client.unmute()
Acceptance criteria
Raised by the DX intelligence system.
Summary
Add
mute()andunmute()convenience methods to the streaming WebSocket clients (ListenWebSocketClientandAsyncListenWebSocketClient) that pause audio transmission while keeping the connection alive, without requiring developers to manually manage KeepAlive timers.Problem it solves
Developers building voice applications frequently need to pause transcription (e.g., when the user clicks a mute button, during hold music, or when switching audio sources) without tearing down and re-establishing the WebSocket connection. Currently, implementing mute requires manually stopping audio sends and managing KeepAlive messages to prevent connection timeout — a pattern that's error-prone and requires understanding Deepgram's connection lifecycle. A simple
mute()/unmute()API reduces this to one line of code and handles the KeepAlive internally.Proposed API
Acceptance criteria
mute()method stops forwarding audio to Deepgram and starts automatic KeepAliveunmute()method resumes audio forwarding and stops the KeepAlive timeris_mutedproperty exposes current mute stateRaised by the DX intelligence system.