Set usage of USB audio device
1. API Description
This API is used to set the usage of USB audio device
Request mode:
- V2.6.0 and above: POST [ip]/mwapi/V2.0/audio/set-usb-audio
- V2.5.0 and below: POST [ip]/mwapi/set-usb-audio
Administrator Rights | Logged-in |
---|---|
No | Yes |
2. Input Parameters
Name | Required | Type | Description |
---|---|---|---|
target | Yes | Int | Set the usage of USB audio device. 0: Audio switching in/out along with the WEB CAMERA video. 1: Global microphone 2: audio playback device |
dev-path | Yes | String | The unique identifier of the device, which can be obtained via Get external audio device list |
audioOffset | Yes | Int | Set the audio offset, in ms |
3. Output Parameters
Name | Type | Description |
---|---|---|
status | Int | Status code |
4. Example
Set "HDMI [USB Capture HDMI+] #1" as the audio that switches in/out along with the WEB CAMERA video, and set the audio offset to -150ms.
Input Example
{
"target": 0,
"dev-path": "aHc6Mywx",
"audioOffset": -150
}
Output Example
{
"status": 0,
}
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 |