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

mediaGetMicIndex (Querying the Microphone in Use)

Interface Description

This interface is invoked to query the microphone in use and return the serial number of the microphone.

Notes

  • The WebSocket connection with the OpenEye is set up.
  • This interface is invoked for interface test or product commissioning. It will not be invoked in actual business scenarios.

Method Definition

OpenEyeCall.prototype.mediaGetMicIndex = function(callbacks)

Parameter Description

Table 1 Parameter description

Parameter

Type

Mandatory/Optional

Description

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.

param

Param

Current microphone.

Table 4 Param

Parameter

Type

Description

index

Number

Serial number of the current microphone.

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

{
   "description" : "tsdk_get_mic_index",
   "param" : {
      "index" : 0
   },
   "result" : 0,
   "rsp" : 67552
}

Examples

function mediaGetMicIndex() {
    global_openEye_SDK.openEyeCall.mediaGetMicIndex({ response: mediaGetMicIndexResponse });
}

function mediaGetMicIndexResponse(data) {
    console.info(data);
    if (data.result == 0) {
        console.info("MediaGetMicIndex success")
    } else {
        console.error("MediaGetMicIndex failed");
    }
}