Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IAudioManager

interface IAudioManager
Extends com.amazon.apmf.IStandard Interface for encapsulating the Audio Manager module

Methods

setVolume()

void setVolume(VolumeType* volType, i32 volume)
Set volume of specified volume type. If the volume is out of range, it will be clamped.

Parameters

volType
VolumeType* — Required type of volume to set (Music / Notification / etc.)
volume
i32 — Required percentage (range: 0 to 100). Needs privilege “com.amazon.audio.privilege.settings.control”

setActiveVolume()

void setActiveVolume(i32 volume)
Set volume of active stream. If the volume is out of range, it will be clamped.

Parameters

volume
i32 — Required (range: 0 to 100). Needs privilege “com.amazon.audio.privilege.settings.control”

updateVolume()

void updateVolume(VolumeType* volType, VolumeUpdate* update)
Update volume of a specific type (for e.g. Music / Notification etc.).

Parameters

volType
VolumeType* — Required volume type to update (Music / Notification / etc.)
update
VolumeUpdate* — Required volume adjustment up/down Needs privilege “com.amazon.audio.privilege.settings.control”

updateActiveVolume()

void updateActiveVolume(VolumeUpdate* update, VolumeType* fallbackType)
Update volume of active stream. If there is no active stream, audio server will set volume for fallback type.

Parameters

update
VolumeUpdate* — Required volume up/down
fallbackType
VolumeType* — Required audio volume type to set if playback is not active Needs privilege “com.amazon.audio.privilege.settings.control”

getVolume()

i32 getVolume(VolumeType* volType)
Get volume of a specific type (for e.g. Music / Notification etc.).

Parameters

volType
VolumeType* — Required volume type (Music / Notification / etc.)

Returns

i32 volume (range: 0 to 100). Needs privilege “com.amazon.audio.privilege.settings.control”

enableAllMicrophones()

void enableAllMicrophones()
Enable the microphones for audio record. If not enabled, the captured audio will be silence. Needs privilege “com.amazon.audio.privilege.settings.control”

disableAllMicrophones()

void disableAllMicrophones()
Disable the microphones for audio record. The apps will receive silence audio. If telephony call is started the uplink audio will be muted. Needs privilege “com.amazon.audio.privilege.settings.control”

isAnyMicrophoneEnabled()

bool isAnyMicrophoneEnabled()
Check if microphones are enabled for recording

Returns

bool true if enabled, false otherwise.

setTelephonyMute()

void setTelephonyMute(IAudioDevice* device, bool mute)
Mute/Unmute the telephony uplink. Telephony uplink will be muted/unmuted.

Parameters

device
IAudioDevice* — Required telephony device to set mute state
mute
bool — Required if true and unmute otherwise Needs privilege “com.amazon.audio.privilege.settings.control”

getTelephonyMute()

bool getTelephonyMute(IAudioDevice* device)
Check if telephony uplink is muted.

Parameters

device
IAudioDevice* — Required telephony device to get mute state

Returns

bool telephony mute status

setMute()

void setMute(VolumeType* volType, bool mute)
Set mute for audio volume type. Mute when true, audio output for volume type will be silenced regardless of individual stream volumes.

Parameters

volType
VolumeType* — Required volume type (Music / Notification / etc.)
mute
bool — Required true to mute, false to unmute. Needs privilege “com.amazon.audio.privilege.settings.control”

getMute()

bool getMute(VolumeType* volType)
Query current mute for audio volume type.

Parameters

volType
VolumeType* — Required volume type (Music / Notification / etc.)

Returns

bool mute status of specified volume type.

setGlobalVolumeMute()

void setGlobalVolumeMute(bool mute)
Set global volume mute. Global mute when true, audio output will be silenced regardless of individual stream volumes.

Parameters

mute
bool — Required true to mute, false to unmute. Needs privilege “com.amazon.audio.privilege.settings.control”

getGlobalVolumeMute()

bool getGlobalVolumeMute()
Query current global volume mute.

Returns

bool global volume mute.

getAudioUsageStatistics()

void getAudioUsageStatistics(AudioUsage* usage, out bool* active, out com.amazon.apmf.RealTimeDuration* pastDurationMs)
Query audio usage statistics: active status and related duration

Parameters

usage
AudioUsage* — Required usage type
active (out)
bool* — Required set to true if this usage is active now, that is, at least one audio stream with such usage is streaming, false or otherwise
pastDurationMs (out)
com.amazon.apmf.RealTimeDuration* — Required duration in milliseconds since audio usage was active/inactive

startTelephony()

void startTelephony(IAudioDevice* device, TelephonyMode* mode)
Start telephony call from the specified device On some specific platforms, it is possible to support multiple telephony sources such as a HFP device, a voice call modem etc. In such case, the client can actually query the list of devices using the getAllAudioDevices API and select a specific device

Parameters

device
IAudioDevice* — Required telephony device information.
mode
TelephonyMode* — Required telephony mode

stopTelephony()

void stopTelephony(IAudioDevice* device)
Stop telephony call from the specified device

Parameters

device
IAudioDevice* — Required telephony device information.

connect()

void connect(IAudioDevice* device)
Connect an audio device

Parameters

device
IAudioDevice* — Required device information such as type, name.

disconnect()

void disconnect(IAudioDevice* device)
Disconnect an audio device

Parameters

device
IAudioDevice* — Required device information such as type, name.

isConnected()

bool isConnected(IAudioDevice* device)
Get an audio device connect/disconnect state.

Parameters

device
IAudioDevice* — Required device information such as type, name.

Returns

bool true if connected, false otherwise.

getAllAudioDevices()

IAudioDeviceInfo*[] getAllAudioDevices(AudioRole* role)
Get the list of connected audio devices of given role To get a list of all the supported roles, specify AudioRole::SOURCE_SINK.

Parameters

role
AudioRole* — Required audio device role sink/source or both.

Returns

IAudioDeviceInfo*[] list of device info array of the available devices of requested role.

setMaxVolume()

void setMaxVolume(i32 maxVolume)
Set max volume limit. Clients can use this API to set maximum limit on all types of volume levels. By default the maximum volume limit is 100, using this API it can be set to 0 - 100. If the volume is out of range, it will be clamped.

Parameters

maxVolume
i32 — Required max limit in percentage for the final volume applies on a stream. Needs privilege “com.amazon.audio.privilege.settings.control”

getMaxVolume()

i32 getMaxVolume()
Get max volume limit Retrieve previously set max volume limit using setMaxVolume() api or system default, value 0 - 100.

Returns

i32 current max volume limit.

setSinkFormatsSelectionPolicy()

void setSinkFormatsSelectionPolicy(SinkFormatsSelectionPolicy* policy)
Set audio sink formats selection policy

Parameters

policy
SinkFormatsSelectionPolicy* — Required policy to select supported audio formats for a sink device

getSinkFormatsSelectionPolicy()

SinkFormatsSelectionPolicy getSinkFormatsSelectionPolicy()
Get the current audio sink mode formats selection policy

Returns

SinkFormatsSelectionPolicy current sink formats selection policy

getSupportedSinkFormatsSelectionPolicies()

SinkFormatsSelectionPolicy[] getSupportedSinkFormatsSelectionPolicies()
Get the list of all supported sink formats selection policies

Returns

SinkFormatsSelectionPolicy[] list of policies

getSupportedPlaybackConfigurations()

AudioConfig[] getSupportedPlaybackConfigurations(AudioAttributes* attributes, AudioDeviceType* deviceType)
query audio pipeline for a list of supported audio configurations for playback.

Parameters

attributes
AudioAttributes* — Required audio stream attributes
deviceType
AudioDeviceType* — Required target device type

Returns

AudioConfig[] list of audio playback configurations for the specified attributes and device type. If the device type is not specified i.e. nullptr, return supported configurations for the playback devices applicable for specified attributes.

addAudioEventListener()

com.amazon.apmf.ISubscription* addAudioEventListener(IAudioEventListener* callback)
Registers a listener to be notified of volume updates.

Parameters

callback
IAudioEventListener* — Required pointer to listener

Returns

com.amazon.apmf.ISubscription* ISubscription pointer to be used to unsubscribe to the listener
Last modified on October 29, 2026