The Audio Manager listens for commands on this control object
Besides reading from and writing to the PPS audio objects directly, you may also use the Audio Manager library, which allows your apps to process events from audio devices. This library provides a C/C++ interface to audio devices accessible through the underlying PPS framework. Using this library, you can get and set audio device properties and can also add and remove device events to notify clients that are using audio devices. For more information, see the Audio Manager Library Reference.
Commands sent to the /pps/services/audio/control object are of the form:
msg::command_string\nid::ID_number\ndat:json:{JSON_data}
Responses always reflect the command_string and ID_number that were sent in the message, along with any errors:
res::command_string\nid::ID_number\ndat:json:{JSON_data}\nerror::error_description
Command | Parameters | Data type | Description |
---|---|---|---|
adjust_input_level | name | String | Device name, as listed under /pps/services/audio/devices/. |
level | Double | Percentage representing the adjustment of the input volume level. | |
adjust_output_level | name | String | Device name. The device's volumecontrol must be percentage. |
level | Double | Percentage representing the adjustment of the output volume level. | |
adjust_voice_output_level | name | String | Name of the device to adjust the output volume level when a voice call is activated. |
level | Double | Percentage representing the adjustment of the voice output volume level. | |
decrease_output_level | name | String | Device name. The device's volumecontrol can be percentage or simple. |
get_a2dp_status | supported | Boolean | Indicates whether the paired device supports A2DP. |
connected | Boolean | Indicates whether the A2DP stream is connected. | |
numchans | Number | Number of channels that the A2DP stream supports (1 or 2). | |
volumecontrol | String | Type of volume control that the current device supports for A2DP:
Default is unavailable. |
|
state | String | State of the A2DP stream:
|
|
get_device_property | name | String | Device name. |
property | String | Name of the device's attribute. | |
value | String | Value of the given attribute. | |
get_hdmi_info | numchans | Number | Number of audio channels that the connected HDMI device supports. |
hdmiorder | String | Audio channel order of the connected HDMI device (e.g., FL,FR). | |
audioconfig | String | Configuration of the audio output channels (e.g., "2.0", "5.1"). Note that this is used only by the hdmi device. | |
mirror | Boolean | Indicates whether mirror mode is enabled. | |
keep_alive | Boolean | Indicates whether the hdmi driver is to be kept alive when no audio stream is active. | |
enabled | Boolean | Indicates whether the HDMI device is enabled. | |
volumecontrol | String | Type of volume control that the attached HDMI device supports:
|
|
get_headphone_enable | name | String | Device name. |
get_hfpg_sco_state | supported | Boolean | Indicates whether the paired device supports HFP. |
connected | Boolean | Indicates whether the handsfree connection can be established. | |
volumecontrol | String | Type of volume control that the current device supports for A2DP:
Default is unavailable. |
|
audioprocessing | Boolean | Indicates whether the paired device needs audio processing by the handset or modem. | |
state | String | State of the handsfree connection:
|
|
suspended | Boolean | Indicates whether HFP is suspended as requested by the device. Default is false. | |
remoteVAD | Boolean | Indicates whether HFP also supports VAD and voice recording. | |
get_input_level | name | String |
Device name. If an invalid name is given, the input level of the currently selected input device is returned. If the given device is output only, the level of the corresponding input device when the output device is selected is returned. |
get_input_mute | name | String | Device name. |
get_output_level | name | String | Device name. The device's volumecontrol must be percentage. |
get_output_mute | name | String | Device name. The device's volumecontrol must be percentage. |
get_voice_output_level | name | String | Name of the device to get the output volume level when a voice call is activated. |
level | Double | Percentage representing the current output volume level. | |
get_voice_output_mute | name | String | Device name. |
muted | Boolean | Indicates whether the device output is muted. | |
increase_output_level | name | String | Device name. The device's volumecontrol can be percentage or simple. |
keep_output_alive | name | String | Device name. |
keep_alive | Boolean | Indicates whether the given output device is to be kept alive when no audio stream is active. | |
set_audio_mode (deprecated) | audiomode | String | Tunings to apply to the hardware codec:
|
set_hac_enabled | enabled | Boolean | Indicates whether Hearing Aid Compatibility (HAC) is enabled for voice handset mode. |
set_hdmi_enable | enabled | Boolean | Indicates whether an HDMI device is connected. The HDMI
device is activated only when these conditions are met:
|
set_hdmi_info | numchans | Number | Number of audio channels supported by the connected HDMI device. |
hdmiorder | String | Audio channel order of the connected HDMI device (e.g., FL,FR). | |
audioconfig | String | Configuration of the audio output channels (e.g., "2.0", "5.1"). Note that this is used only by the hdmi device. | |
volumecontrol | String | Type of volume control supported by the attached HDMI device:
The hdmi audio driver sends HDMI information to the Audio Manager before the HDMI handler calls set_hdmi_enable, to prevent this function from publishing inaccurate information. |
|
set_hdmi_mode | mirror | Boolean | Indicates whether mirror mode is enabled. |
set_headphone_enable (may be deprecated) | name | String | Name of the device to be activated as the default when this event occurs. |
enabled | Boolean | Indicates whether the headphone is enabled as the output. | |
set_headphone_override | hpoverride | Boolean | Indicates whether headphone volume boost is enabled. If enabled, a volume level greater than 92% is allowed. |
set_input_level | name | String | Device name. If an invalid name is given, the input level of the currently selected input device is returned. If the given device is output only, the level of the corresponding input device when the output device is selected is returned. |
level | Double | Percentage representing the desired input volume level. | |
set_input_mute | name | String | Device name. |
muted | Boolean | Indicates whether the given device input is muted. | |
set_output_level | name | String | Device name. The device's volumecontrol must be percentage. |
level | Double | Percentage representing the desired output volume level. | |
set_output_mute | name | String | Device name. The device's volumecontrol must be percentage. |
muted | Boolean | Indicates whether the given device output is muted. | |
set_toslink_enable | enabled | Boolean | Indicates whether a TOSLINK connection is used. |
set_tty_enabled | enabled | Boolean | Indicates whether TTY mode is selected for voice headset mode. The Audio Manager automatically picks TTY mode only when a headset is connected and if so, TTY is enabled during a voice call. |
set_voice_output_level | name | String | Name of the device to set the voice output volume level when a voice call is activated. |
level | Double | Percentage representing the desired output volume level. | |
set_voice_output_mute | name | String | Device to mute/unmute. |
muted | Boolean | Indicates whether the device output is muted. | |
toggle_input_mute | name | String | Device name. If an invalid name is given, the input level of the currently selected input device is updated. If the given device is output only, the corresponding input device when the output device is selected is updated. |
toggle_output_mute | name | String | Device name. The device's volumecontrol must be percentage. |
toggle_voice_output_mute | name | String | Name of the device to toggle the mute status when a voice call is activated. |
To set the volume level of the headset to 75%:
To mute the speaker:
msg::set_output_mute\nid::2\ndat:json:{"name":"speaker","muted":"true"}