Mute
Mutes local audio for your leg in an active call. When muted, remote participants cannot hear your microphone audio.
Signature
// Callback version
fun mute(
callId: String,
callback: (Exception?) -> Unit
)
// Suspend version
suspend fun mute(
callId: String
)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
callId | string | Yes | Identifier of the active call |
Return Type
Returns void (or Promise<void> for Web).
Usage Example
// Callback
client.mute("callId") {
it?.let { err ->
// Handle Error in muting call
println("Error in muting call: $err")
}
}
// Coroutine
try {
client.mute("callId")
} catch (e: Error) {
// Handle Error in muting call
}
Errors
| Error Type | Error Code | Description |
|---|---|---|
INTERNAL_ERROR | voice:error:no_call_found | No active call found for provided callId |
INTERNAL_ERROR | Media-layer errors | Media operation failed while muting |
UNKNOWN_ERROR | N/A | Unexpected failure |
For complete error reference and handling guidelines, see Error Reference.
Notes
- Mute affects only your outgoing audio stream
- Call remains active and incoming audio is unaffected
Related Actions
unmute- Unmute local audio
Related Events
onMute- Fired when mute state changes for a leg