Get external audio device list
1. API Description
This API is used to get the external audio device list.
Request mode:
- V2.6.0 and above: POST [ip]/mwapi/V2.0/audio/get-usb-audio-list
- V2.5.0 and below: POST [ip]/mwapi/get-usb-audio-list
| Administrator Rights | Logged-in |
|---|---|
| No | Yes |
2. Input Parameters
| Name | Required | Type | Description |
|---|---|---|---|
| target | Yes | Int | Choose an audio setting item to fetch the corresponding device list: 0: Get available audio devices for Web Camera. 1: Get available microphone devices. 2: Get available USB audio playback devices. |
3. Output Parameters
| Name | Type | Description |
|---|---|---|
| status | Int | Status code |
| selected | Boolean | Whether a device is selected for the audio setting item true: Yes; false: No |
| audioOffset | Int | The audio offset, in ms |
| cur-dev-path | String | The selected device. Null indicates no device is selected. |
| devices | Array of DeviceData | Array of devices |
DeviceData
| Name | Type | Description |
|---|---|---|
| dev-path | String | The unique identifier of the device |
| dev-name | String | The device name |
4. Example
Getting the available audio device list for Web Camera.
Input Example
{
"target": 0,
}
Output Example
{
"status": 0,
"selected": false,
"audioOffset": -150,
"cur-dev-path": "",
"devices": [
{
"dev-path": "aHc6Mywx",
"dev-name": "HDMI [USB Capture HDMI+] #1"
},
{
"dev-path": "aHc6Mywy",
"dev-name": "HDMI [USB Capture HDMI+] #2"
}
]
}
5. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Status | Definition | Description |
|---|---|---|
| 7 | MW_STATUS_INVALID_ARG | Missing required parameters |