Enable Earmuff
Enables earmuff for your leg in an active call. While enabled, incoming audio is blocked locally.
Signature
// Callback version
fun enableEarmuff(
callId: String,
callback: (Exception?) -> Unit
)
// Suspend version
suspend fun enableEarmuff(
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.enableEarmuff("callId") {
it?.let { err ->
// Handle Error in enabling earmuff
println("Error in enabling earmuff: $err")
}
}
// Coroutine
try {
client.enableEarmuff("callId")
} catch (e: Error) {
// Handle Error in enabling earmuff
}
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 enabling earmuff |
UNKNOWN_ERROR | N/A | Unexpected failure |
For complete error reference and handling guidelines, see Error Reference.
Notes
- Earmuff affects incoming audio only on your local leg
- Outgoing audio is unaffected; use
muteto stop outgoing audio
Related Actions
disableEarmuff- Disable earmuff and restore incoming audio
Related Events
onEarmuff- Fired when earmuff state changes for a leg