- TOC
Required privileges
The API requires specific privileges for certain operations:Types Used
Refer to Audio core typesAudioVolumeTypeAudioVolumeFlagsAudioStatusAudioEventAudioDeviceAudioRoleAudioAttributesAudioContentTypeAudioUsageTypeAudioFlagsSinkFormatsSelectionPolicy
Static Methods
AudioManager.setVolumeAsync(type, volume, flags)
Description
Sets the volume of a type of audio to a specified volume. If a volume larger than 100 is input, it will set the volume to 100. If a volume less than than 0 is input, it will set the volume to 0.Return Value
Returns a promise that resolves to an AudioStatus type.Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
Example code
AudioManager.getVolumeAsync(type)
Description
Retrieves volume of a specified audio type.Return Value
Returns a promise that resolves to an integer representing what percentage the volume for a specific type is currently at.Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
Example code
AudioManager.setMicMuteAsync(mute)
Description
Mutes or unmutes all microphone input based on the boolean input.Return Value
Returns a promise that resolves to an AudioStatus type.Parameters
Example code
AudioManager.getMicMuteAsync()
Description
Retrieves the mute status of microphone input.Return Value
Returns a promise that resolves to a boolean representing mute status of microphone input.Example code
AudioManager.setGlobalVolumeMuteAsync(mute, flags)
Description
Mutes or unmutes all audio source types globally based on the boolean input.Return Value
Returns a promise that resolves to an AudioStatus type.Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
Example Code
AudioManager.getGlobalVolumeMuteAsync()
Description
Retrieves global mute status.Return Value
Returns a promise that resolves to a boolean representing global mute status.Example Code
AudioManager.registerAudioEventObserverAsync(callback)
Description
Registers a callback function that executes anytime an audio change event is detected. Only one callback function can be registered at a time.Return Value
Returns a promise that resolves to an AudioStatus type.Parameters
Example code
AudioManager.unregisterAudioEventObserverAsync()
Description
Unregisters any callback function that is currently registered. If there are no callbacks registered, nothing happens.Return Value
Returns a promise that resolves to an AudioStatus type.Example code
AudioManager.isServerReadyAsync()
Description
Checks if the AudioServer is ready to process commands.Return Value
Returns a promise resolving to a boolean value that indicates whether the server is ready.Example code
AudioManager.setTelephonyMuteAsync(device, address, mute)
Description
Mute/unmute the telephony uplink.Return Value
Returns Promise with audio status code (AudioStatus type)Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
Example code
AudioManager.getTelephonyMuteAsync(device, address)
Description
Mute/unmute the telephony uplink.Return Value
Returns Promise with audio status code (AudioStatus type)Parameters
Example code
AudioManager.setActiveVolumeAsync(volume)
Description
Set volume of active stream.Return Value
Returns Promise with audio status code (AudioStatus type)Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
Example code
AudioManager.updateVolumeAsync(type, mode)
Description
Update volume of a specific type (for e.g. Music / Notification etc.)Return Value
Returns Promise with audio status code (AudioStatus type)Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
Example code
AudioManager.updateActiveVolumeAsync(update, fallbackType)
Description
Update volume of active stream If there is no active stream, audio server will set volume for fallback typeReturn Value
Returns Promise with audio status code (AudioStatus type)Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
|Parameter Name |Type |Required |Description |
|— |— |— |— |
|update |Int32 |Yes |0 = Increase, 1 = Decrease |
|fallbackType |VolumeType |Yes |Volume type to be updated |
Example code
AudioManager.setMuteAsync(volType, mute)
Description
Set mute for audio volume type. Mute when true, audio output for volume type will be silenced regardless of individual stream volumes.Return Value
Returns Promise with audio status code (AudioStatus type)Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
Example code
AudioManager.getMuteAsync(volType)
Description
Query current mute for audio volume typeReturn Value
Returns Promise with mute state (boolean)Parameters
Example code
AudioManager.setMaxVolumeAsync(maxVolume)
Description
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.Return Value
Returns Promise with audio status code (AudioStatus type)Parameters
Needs privilegecom.amazon.audio.privilege.settings.control
Example code
AudioManager.getMaxVolumeAsync()
Description
Get max volume limit Retrieve previously set max volume limit using setMaxVolume() api or system default, value 0 - 100.Return Value
Returns Promise with current max volume limit (Int32).Parameters
| Parameter Name | Type | Required | Description | | ————– | —- | ——– | ———– |Example code
AudioManager.getSupportedPlaybackConfigurationsAsync(attributes, deviceType)
Description
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.Return Value
Returns Promise with an array of objects which containins all the supported audio configurations for the given parameters. The structure of the received objects contains: {- sampleRate: AudioSampleRate
- channelMask: AudioChannelMask
- format: AudioSampleFormat
- layout: SampleLayout

