setAudioVolume (v1.2)
Estimated reading time: 1 minute
- 此API提供了更改音频音量级别的功能。
语法
- http://<Base URL>/audio
认证级别
- generic
需求
- params' Elements
- An object composed of the following pair(s).
name | type | multiplicity | default | description |
---|---|---|---|---|
target | string | 1 | 声音的输出目标。
定义了以下值。
|
|
volume | string | 1 | 要设置的卷级别。应用以下格式。
|
|
ui | string | ? | null |
如果需要显示UI(音量条等),请将其设置为“开”。
|
- JSON Example
-
{ "method": "setAudioVolume", "id": 98, "params": [{ "volume": "5", "ui": "on", "target": "speaker" }], "version": "1.2" }
Response
- result's Elements
- Not necessary.
- JSON Example
-
{ "result": [], "id": 98 }
- Error Code
- The following error codes are important for this API. Refer to error code for other errors.
code | Explanation |
---|---|
40800 | Target is not supported or cannot be controlled for some device-specific reason. |
40801 | Volume is out of range. |
Last modified: 13 Feb 2019