Description
This API is used to create a listening instance.
Example
Parameter
Field | Type | Description | Default Value | Required |
---|---|---|---|---|
devId | string | Unique identifier of a device | Yes | |
channel | string | Channel number | Yes | |
mediaProtocol | string | Media protocol: WS | WS | No |
expireTime | Number | The address expiration time (in seconds) | 20 | No |
optId | String | Operation ID, used for operation logging purposes | "" | No |
addrType | number | Address type: 1 for WAN, 2 for LAN | 1 | No |
startPrompt | ArrayBuffer | Start listening prompt sound. PCM format, 8000Hz sample rate, 16-bit, mono channel. | No | |
stopPrompt | ArrayBuffer | Stop listening prompt sound. PCM format, 8000Hz sample rate, 16-bit, mono channel. | No |
Description
Start listening.
Example
Description
Stop listening.
Example
Description
This method is used to obtain the start time of the listening session, returning the UTC timestamp to the client in milliseconds.
Example
Note: To get the end time, please refer to the afterDestroy hook in HOOKS.
Description
This method is used to obtain the duration of the listening session (in milliseconds).
Example
Description
This property is used to set the play volume on the client side.
Example
This property is used to set the value range as a number, representing the expected channel volume with a range from 0 to 1.