summaryrefslogtreecommitdiffstats
path: root/docs/high-level-api/reference.md
blob: 47e7b3fa84aaf664853cb4867191a20cb5b08721 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Reference

## Verbs

### ahl-4a/get_roles
Get the list of available audio roles. By default it returns the list of roles that are bounded to a stream. To get a list of all defined roles, regardless if they are bound to a stream or not, you can pass the following parameter.
```json
{
    "verbose": true
}
```

### ahl-4a/[role]
Replace [role] by the role's name. For exemple **ahl-4a/multimedia**.

This verb allow the control of the audio role. The action executed depend on the parameter.

#### Open
```json
{ "action": "open" }
```
Request to open the role.

On success it returns the device URI to open. This action fails if the role is already opened.

When a role is opened, it triggers the first interruption of the policy engine.

The policy engine execute the interruption for each opened audio role with a lower priority.

#### Close
```json
{ "action": "close" }
```
Request to close the role.

On success it closes the role. You can only close roles that you opened. An error will occurs if you try to close a role that an other application opened.

#### Volume
```json
{
    "action": "volume",
    "value": 80
}
```
Request to get or set the volume.

Value can be absolute or relative. Use a string as value to use relative, like **"+10"** or **"-20"**. To get the volume you can use **"+0"** as value.

#### Mute
```json
{
    "action": "mute"
}
```
Mute the volume of this.

#### Unmute
```json
{
    "action": "unmute"
}
```
Unmute the volume of this role.

#### Interrupt
```json
{
    "action": "interrupt"
}
```
Ask the policy engine to execute an interruption.