Updated on 2023-10-12 GMT+08:00

operateMic (Muting the Microphone)

Interface Description

This interface is invoked to mute or unmute the microphone.

Notes

A call is set up.

Method Definition

OpenEyeCall.prototype.operateMic = function(callid, to_mute, callbacks) 

Parameter Description

Table 1 Parameter description

Parameter

Type

Mandatory/Optional

Description

callid

Number

Mandatory

Call ID.

to_mute

Number

Mandatory

Whether to mute the microphone. The value 1 indicates that the call is muted, and the value 0 indicates that the call is resumed.

callbacks

Callback

Optional

Callback method.

Table 2 Callback

Parameter

Type

Mandatory/Optional

Description

response

function

Mandatory

For details about the input parameters of the callback method, see Table 3.

Table 3 Input parameters of the callback method

Parameter

Type

Description

description

String

Description of the current request.

result

Number

Query result. The value 0 indicates success and other values indicate failure.

rsp

Number

Internal message ID.

The following is an example of input parameters of the callback method:

{
   "description" : "tsdk_mute_mic",
   "result" : 0,
   "rsp" : 67547
}

Examples

/**
* Muting/Unmuting
* @param {*} flag 1: mute; 0: unmute
 */
function operateMic(flag) {
     global_openEye_SDK.openEyeCall.operateMic(1755709440, flag, { response: onOperateMicResponse });
}

function onOperateMicResponse(data) {
    if (data.result == 0) {
        console.info("OperateMic success. ");
    } else {
        console.error("OperateMic failed. The ErrorCode is " + data.result);
        console.info(data);
    }
}