AudioManager
Constructors
new AudioManager()
new AudioManager():
AudioManager
Returns
Methods
allocateCustomAudioEffectSessionAsync()
static
allocateCustomAudioEffectSessionAsync():Promise
<number
>
Creates a unique session ID for custom audio effects. This ID can be used to associate audio effects with specific playback or record streams.
Returns
Promise
<number
>
A promise that resolves to:
- Positive number: New unique session ID
Rejects with:
STATUS_NO_MEMORY (-1)
: Failed to allocate sessionSTATUS_DEAD_OBJECT (-5)
: Server connection lost
areSystemSoundsEnabledAsync()
static
areSystemSoundsEnabledAsync():Promise
<boolean
>
Checks if system sounds are currently enabled.
Returns
Promise
<boolean
>
A promise that resolves to:
true
: System sounds are enabledfalse
: System sounds are disabled
Rejects with:
STATUS_DEAD_OBJECT (-5)
: Server connection lost
disableAvrcpAbsoluteVolumeAsync()
static
disableAvrcpAbsoluteVolumeAsync(btAddress
):Promise
<AudioStatus
>
Disables AVRCP absolute volume control for a Bluetooth device.
When disabled, volume control is handled by the system.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
btAddress
String
Bluetooth device address
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid addressSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_INVALID_OPERATION (-8)
: Device doesn't support AVRCPSTATUS_DEAD_OBJECT (-5)
: Server connection lost
disableSystemSoundsAsync()
static
disableSystemSoundsAsync():Promise
<AudioStatus
>
Disables all system sounds. System sounds will not play until re-enabled with enableSystemSoundsAsync.
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_DEAD_OBJECT (-5)
: Server connection lostSTATUS_INVALID_OPERATION (-8)
: Operation failed
disableUsageAsync()
static
disableUsageAsync(usage
):Promise
<AudioStatus
>
Disables audio playback for a specific usage type.
Currently only supports USAGE_NOTIFICATION
.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
usage
number
Usage type to disable
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid or unsupported usage typeSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
enableAvrcpAbsoluteVolumeAsync()
static
enableAvrcpAbsoluteVolumeAsync(btAddress
):Promise
<AudioStatus
>
Enables AVRCP absolute volume control for a Bluetooth device.
When enabled, volume control is handled by the Bluetooth device itself.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
btAddress
String
Bluetooth device address
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid addressSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_INVALID_OPERATION (-8)
: Device doesn't support AVRCPSTATUS_DEAD_OBJECT (-5)
: Server connection lost
enableSystemSoundsAsync()
static
enableSystemSoundsAsync():Promise
<AudioStatus
>
Enables system sounds after they have been disabled. System sounds are enabled by default.
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_DEAD_OBJECT (-5)
: Server connection lostSTATUS_INVALID_OPERATION (-8)
: Operation failed
enableUsageAsync()
static
enableUsageAsync(usage
):Promise
<AudioStatus
>
Enables audio playback for a specific usage type.
Currently only supports USAGE_NOTIFICATION
.
When setting other usages, the function will throw
"[com.amazon.apmf.SecurityError]: No Permission" exception.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
usage
number
Usage type to enable
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid or unsupported usage typeSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
getAudioDeviceListAsync()
static
getAudioDeviceListAsync(device
,role
):Promise
<AudioDeviceInfo
[]>
Gets a list of available audio devices matching the specified role.
Parameters
device
Device type to filter by, or DEVICE_ALL for all devices. Values:
DEVICE_NONE (0x0)
DEVICE_DEFAULT (1 << 30)
DEVICE_SPEAKER (1 << 0)
DEVICE_WIRED_HEADSET (1 << 1)
DEVICE_BLUETOOTH_SCO (1 << 2)
DEVICE_BLUETOOTH_A2DP (1 << 3)
- And others as defined in AudioDevice enum
role
Role to filter by. Values:
ROLE_SOURCE (0)
: Input devicesROLE_SINK (1)
: Output devicesROLE_SOURCE_SINK (2)
: Both input and output devices
Returns
Promise
<AudioDeviceInfo
[]>
A promise that resolves to an array of AudioDeviceInfo objects:
Each object contains:
role
: AudioRoletype
: AudioDevicename
: stringformats
: AudioSampleFormat[]sampleRates
: AudioSampleRate[]channelMasks
: AudioChannelMask[]
Rejects with:
STATUS_BAD_VALUE (-2)
: Invalid parametersSTATUS_DEAD_OBJECT (-5)
: Server connection lost
getGlobalVolumeMuteAsync()
static
getGlobalVolumeMuteAsync():Promise
<boolean
>
Gets the current global volume mute state.
Returns
Promise
<boolean
>
A promise that resolves to:
true
: Global mute is enabledfalse
: Global mute is disabled
Rejects with:
STATUS_DEAD_OBJECT (-5)
: Server connection lost
getMajorVersion()
static
getMajorVersion():number
Gets the major version number of the AudioManager. Can be used to make version checks.
Returns
number
The major version number
getMaxVolumeAsync()
static
getMaxVolumeAsync():Promise
<number
>
Gets the current maximum volume limit.
Returns
Promise
<number
>
A promise that resolves to:
- 0-100: Current maximum volume limit
Rejects with:
STATUS_DEAD_OBJECT (-5)
: Server connection lost
getMicMuteAsync()
static
getMicMuteAsync():Promise
<boolean
>
Gets the current microphone mute state.
Returns
Promise
<boolean
>
A promise that resolves to:
true
: Microphone is mutedfalse
: Microphone is not muted
Rejects with:
STATUS_DEAD_OBJECT (-5)
: Server connection lost
getMinorVersion()
static
getMinorVersion():number
Gets the minor version number of the AudioManager. Can be used to make version checks.
Returns
number
The minor version number
getMuteAsync()
static
getMuteAsync(volType
):Promise
<boolean
>
Gets the mute state for a specific volume type.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
volType
Volume type to query. See setVolumeAsync for types.
Returns
Promise
<boolean
>
A promise that resolves to:
true
: Volume type is mutedfalse
: Volume type is not muted
Rejects with:
STATUS_BAD_VALUE (-2)
: Invalid volume typeSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
getPatchVersion()
static
getPatchVersion():number
Gets the patch version number of the AudioManager. Can be used to make version checks.
Returns
number
The patch version number
getSinkFormatsSelectionPolicyAsync()
static
getSinkFormatsSelectionPolicyAsync():Promise
<number
>
Gets the current policy for selecting audio output formats.
Returns
Promise
<number
>
A promise that resolves to:
- SinkFormatsSelectionPolicy value. See setSinkFormatsSelectionPolicyAsync
Rejects with:
STATUS_DEAD_OBJECT (-5)
: Server connection lost
getSupportedPlaybackConfigurationsAsync()
static
getSupportedPlaybackConfigurationsAsync(attributes
,deviceType
):Promise
<AudioConfigAttr
[]>
Gets the supported audio configurations for playback with given attributes and device. Use this to determine valid combinations of format, sample rate, and channels.
Parameters
attributes
Audio attributes defining content type and usage
deviceType
number
Device type to query, use DEVICE_DEFAULT
for current output
Returns
Promise
<AudioConfigAttr
[]>
A promise that resolves to an array of supported configurations:
Each config contains:
sampleRate
: AudioSampleRatechannelMask
: AudioChannelMaskformat
: AudioSampleFormatlayout
: SampleLayout
Rejects with:
STATUS_BAD_VALUE (-2)
: Invalid parametersSTATUS_NOT_ENOUGH_DATA (-10)
: No configurations availableSTATUS_DEAD_OBJECT (-5)
: Server connection lost
getSupportedRecordConfigurationsAsync()
static
getSupportedRecordConfigurationsAsync(excludeDisconnectedDevice
,sourceType
):Promise
<AudioConfigAttr
[]>
Gets supported audio configurations for recording. Use this to determine valid combinations of format, sample rate, and channels for recording.
Parameters
excludeDisconnectedDevice
boolean
When true, only returns configurations for connected devices. When false, returns all supported configurations from config files.
sourceType
number
Audio source type to query configurations for
Returns
Promise
<AudioConfigAttr
[]>
A promise that resolves to an array of supported configurations:
Each config contains:
sampleRate
: AudioSampleRatechannelMask
: AudioChannelMaskformat
: AudioSampleFormatlayout
: SampleLayout
Rejects with:
STATUS_BAD_VALUE (-2)
: Invalid parametersSTATUS_NOT_ENOUGH_DATA (-10)
: No configurations availableSTATUS_DEAD_OBJECT (-5)
: Server connection lost
getSupportedSinkFormatsSelectionPoliciesAsync()
static
getSupportedSinkFormatsSelectionPoliciesAsync():Promise
<SinkPolicies
[]>
Gets a list of supported sink format selection policies. Not all devices support all policies - use this to determine available options.
Returns
Promise
<SinkPolicies
[]>
A promise that resolves to an array of supported policies:
Each entry contains:
- policy: number (
SinkFormatsSelectionPolicy
value)
Rejects with:
STATUS_DEAD_OBJECT (-5)
: Server connection lost
getSystemSoundThemeAsync()
static
getSystemSoundThemeAsync():Promise
<String
>
Gets the currently active system sound theme.
Returns
Promise
<String
>
A promise that resolves to:
- String: Current theme identifier
Rejects with:
STATUS_NO_FILE (-11)
: No theme setSTATUS_DEAD_OBJECT (-5)
: Server connection lost
getSystemSoundThemeListAsync()
static
getSystemSoundThemeListAsync():Promise
<AudioTheme
[]>
Gets a list of all supported system sound themes. System sound themes define different sets of sounds for system events.
Returns
Promise
<AudioTheme
[]>
A promise that resolves to an array of AudioTheme objects:
Each object contains:
theme
: string (theme identifier)
Rejects with:
STATUS_NO_FILE (-11)
: Theme files not foundSTATUS_DEAD_OBJECT (-5)
: Server connection lost
getTelephonyMuteAsync()
static
getTelephonyMuteAsync(device
,address
):Promise
<boolean
>
Gets the mute state for telephony audio on a specific device.
Parameters
device
Device to query
address
String
Unique identifier for the device.
Returns
Promise
<boolean
>
A promise that resolves to:
true
: Telephony audio is mutedfalse
: Telephony audio is not muted
Rejects with:
STATUS_BAD_VALUE (-2)
: Invalid parametersSTATUS_INVALID_OPERATION (-8)
: Device not in telephony modeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
getVolumeAsync()
static
getVolumeAsync(type
):Promise
<number
>
Gets the current volume level for a specific audio type.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
type
The audio type to query. See setVolumeAsync for types.
Returns
Promise
<number
>
A promise that resolves to:
- 0-100: Current volume level
STATUS_BAD_VALUE (-2)
: Invalid typeSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
isAvrcpAbsoluteVolumeEnabledAsync()
static
isAvrcpAbsoluteVolumeEnabledAsync(btAddress
):Promise
<boolean
>
Checks if AVRCP absolute volume control is enabled for a Bluetooth device.
Parameters
btAddress
String
Bluetooth device address
Returns
Promise
<boolean
>
A promise that resolves to:
true
: AVRCP absolute volume is enabledfalse
: AVRCP absolute volume is disabled Rejects with:STATUS_BAD_VALUE (-2)
: Invalid addressSTATUS_INVALID_OPERATION (-8)
: Device doesn't support AVRCPSTATUS_DEAD_OBJECT (-5)
: Server connection lost
isServerReadyAsync()
static
isServerReadyAsync():Promise
<boolean
>
Checks if the audio server is ready to process commands.
Returns
Promise
<boolean
>
A promise that resolves to:
true
: Server is readyfalse
: Server is not ready
Rejects with:
STATUS_DEAD_OBJECT (-5)
: Server connection lost
Deprecated
This method is maintained for backwards compatibility but may be removed in future versions. Use the SERVER_UP/SERVER_DOWN events from registerAudioEventObserverAsync instead.
isUsageEnabledAsync()
static
isUsageEnabledAsync(usage
):Promise
<boolean
>
Checks if audio playback is enabled for a specific usage type.
Parameters
usage
number
Usage type to query
Returns
Promise
<boolean
>
A promise that resolves to:
true
: Usage type is enabledfalse
: Usage type is disabled
Rejects with:
STATUS_BAD_VALUE (-2)
: Invalid usage typeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
playSystemSoundAsync()
static
playSystemSoundAsync(soundType
):Promise
<AudioStatus
>
Plays a system sound.
Parameters
soundType
Type of system sound to play. Values:
BOOT_UP (0)
BACK_BUTTON (1)
HOME_BUTTON (4)
MENU_BUTTON (5)
UP/DOWN/LEFT/RIGHT (6/9)
MIC_ON/OFF (10/11)
BLUETOOTH related (12/14)
ERROR (15)
VOLUME_UP/DOWN (16/17)
- And others as defined in AudioSystemSound enum
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid sound typeSTATUS_NO_FILE (-11)
: Sound file not foundSTATUS_DEAD_OBJECT (-5)
: Server connection lost
registerAudioEventObserverAsync()
static
registerAudioEventObserverAsync(callback
):Promise
<AudioStatus
>
Registers a callback function for audio system events. Only one callback can be registered at a time system-wide.
Parameters
callback
(value
) => void
Callback function receiving events:
DEVICE_STATE_UPDATE (0)
: Audio device connection changed Parameters:{device: AudioDevice, role: AudioRole, connect: boolean}
VOLUME_UPDATE (1)
: Volume changed Parameters:{type: AudioVolumeType, volume: number}
GLOBAL_VOLUME_MUTE_UPDATE (2)
: Global mute changed Parameters:{mute: boolean}
SERVER_DOWN (3)
: Audio server unavailableSERVER_UP (4)
: Audio server availableAUDIO_USAGE_STATE_CHANGE (5)
: Usage state changed Parameters:{usage: AudioUsageType, active: boolean}
MIC_MUTE_STATE_UPDATE (6)
: Microphone mute changed Parameters:{muteState: boolean}
VOLUME_MUTE_UPDATE (7)
: Volume type mute changed Parameters:{volumeType: AudioVolumeType, muteState: boolean}
TELEPHONY_MUTE_UPDATE (8)
: Telephony mute changed Parameters:{deviceType: AudioDevice, deviceAddress: string, deviceName: string, muteState: boolean}
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid callbackSTATUS_ALREADY_EXISTS (-4)
: Callback already registeredSTATUS_DEAD_OBJECT (-5)
: Server connection lost
setActiveVolumeAsync()
static
setActiveVolumeAsync(volume
):Promise
<AudioStatus
>
Sets the volume of the currently active stream.
Active stream is determined by the most recent audio focus holder.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
volume
number
Volume level (0-100). Values outside this range will be clamped.
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid volume valueSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_INVALID_OPERATION (-8)
: No active streamSTATUS_DEAD_OBJECT (-5)
: Server connection lost
setGlobalVolumeMuteAsync()
static
setGlobalVolumeMuteAsync(mute
,flags
):Promise
<AudioStatus
>
Sets the global volume mute state.
When enabled, mutes all audio output regardless of individual volume settings.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
mute
boolean
true to enable global mute, false to disable
flags
AudioVolumeFlags
= AudioVolumeFlags.VOLUME_FLAG_NONE
Optional flags affecting mute behavior:
VOLUME_FLAG_NONE (0)
: No special behaviorVOLUME_FLAG_SHOW_UI (1)
: Show mute state UIVOLUME_FLAG_PLAY_NOTIFICATION (2)
: Play state change sound
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lostSTATUS_INVALID_OPERATION (-8)
: Operation failed
setMaxVolumeAsync()
static
setMaxVolumeAsync(maxVolume
):Promise
<AudioStatus
>
Sets the maximum volume limit for all audio types.
This acts as a global volume ceiling that affects all volume types.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
maxVolume
number
Maximum volume level (0-100). Values outside this range will be clamped. Current volumes exceeding this limit will be reduced to match.
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid volume valueSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
setMicMuteAsync()
static
setMicMuteAsync(mute
):Promise
<AudioStatus
>
Sets the microphone mute state. This affects all audio recording from the microphone.
Parameters
mute
boolean
true to mute microphone, false to unmute
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_DEAD_OBJECT (-5)
: Server connection lostSTATUS_INVALID_OPERATION (-8)
: Operation failed
setMuteAsync()
static
setMuteAsync(volType
,mute
):Promise
<AudioStatus
>
Sets the mute state for a specific volume type.
Muting a volume type silences all audio streams of that type.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
volType
Volume type to mute/unmute. See setVolumeAsync for types.
mute
boolean
true to mute, false to unmute
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid volume typeSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
setSinkFormatsSelectionPolicyAsync()
static
setSinkFormatsSelectionPolicyAsync(policy
):Promise
<AudioStatus
>
Sets the policy for selecting audio output formats on HDMI/digital outputs. This affects how audio is encoded when sent to supporting devices.
Parameters
policy
Format selection policy:
AUTO (0)
: Choose based on sink capabilitiesENFORCE_PCM (1)
: Force PCM outputPASSTHROUGH_DDP (2)
: Allow Dolby Digital Plus passthroughPASSTHROUGH_DD (3)
: Allow Dolby Digital passthroughENFORCE_DDP (4)
: Force Dolby Digital Plus encodingENFORCE_DD (5)
: Force Dolby Digital encoding
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid policySTATUS_INVALID_OPERATION (-8)
: Policy not supportedSTATUS_DEAD_OBJECT (-5)
: Server connection lost
setSystemSoundThemeAsync()
static
setSystemSoundThemeAsync(soundTheme
):Promise
<AudioStatus
>
Sets the active system sound theme. The theme must be one of those returned by getSystemSoundThemeListAsync.
Parameters
soundTheme
String
Theme identifier string
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid themeSTATUS_NO_FILE (-11)
: Theme files not foundSTATUS_DEAD_OBJECT (-5)
: Server connection lost
setTelephonyMuteAsync()
static
setTelephonyMuteAsync(device
,address
,mute
):Promise
<AudioStatus
>
Sets the mute state for telephony audio on a specific device.
Parameters
device
Device to set mute state for
address
String
Unique identifier for the device.
mute
boolean
true to mute, false to unmute
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invanvalid parametersSTATUS_INVALID_OPERATION (-8)
: Device not in telephony modeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
setVolumeAsync()
static
setVolumeAsync(type
,volume
,flags
):Promise
<AudioStatus
>
Sets the volume for a specific audio type.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
type
The audio type to adjust:
VOLUME_TYPE_DEFAULT (-1)
VOLUME_TYPE_MEDIA (0)
VOLUME_TYPE_VOICE_ASSISTANT (1)
VOLUME_TYPE_VOICE_CALL (2)
VOLUME_TYPE_RING (3)
VOLUME_TYPE_ALARM (4)
VOLUME_TYPE_NOTIFICATION (5)
VOLUME_TYPE_ACCESSIBILITY (6)
VOLUME_TYPE_SYSTEM (7)
VOLUME_TYPE_NAVIGATION (8)
volume
number
Volume level (0-100). Values outside this range will be clamped.
flags
AudioVolumeFlags
= AudioVolumeFlags.VOLUME_FLAG_NONE
Optional flags affecting volume change behavior:
VOLUME_FLAG_NONE (0)
: No special behaviorVOLUME_FLAG_SHOW_UI (1)
: Show volume slider UIVOLUME_FLAG_PLAY_NOTIFICATION (2)
: Play volume change sound
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid type or volumeSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
startTelephonyAsync()
static
startTelephonyAsync(device
,address
,mode
):Promise
<AudioStatus
>
Start telephony call from the specified device
Client can simply specify the device DEVICE_DEFAULT to let the audio server determine the telephony and initiate the call. On some specific platforms, it is possible to support multiple telephony sources such as HFP device, a voice call modem etc. In such case, the client can actually query the list of devices using the getAudioDeviceListAsync API and select a specific device and corresponding address.
Parameters
device
Device to use for telephony audio. Common values:
DEVICE_DEFAULT (1 << 30)
DEVICE_BLUETOOTH_SCO (1 << 2)
DEVICE_BLUETOOTH_HFP (1 << 18)
DEVICE_WIRED_HEADSET (1 << 1)
address
String
Unique identifier for the device (e.g., Bluetooth address)
mode
Telephony audio mode:
MODE_NARROW_BAND (0)
: Standard voice qualityMODE_WIDE_BAND (1)
: HD voice quality
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid parametersSTATUS_INVALID_OPERATION (-8)
: Device not availableSTATUS_DEAD_OBJECT (-5)
: Server connection lost
stopTelephonyAsync()
static
stopTelephonyAsync(device
,address
):Promise
<AudioStatus
>
Stops telephony audio on the specified device. Must be called when a call ends or when telephony audio is no longer needed.
Parameters
device
Device to stop telephony audio on
address
String
Unique identifier for the device (e.g., Bluetooth address)
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid parametersSTATUS_INVALID_OPERATION (-8)
: Telephony not activeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
unregisterAudioEventObserverAsync()
static
unregisterAudioEventObserverAsync():Promise
<AudioStatus
>
Unregister the previously registered audio event callback.
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_INVALID_OPERATION (-8)
: No callback registeredSTATUS_DEAD_OBJECT (-5)
: Server connection lost
updateActiveVolumeAsync()
static
updateActiveVolumeAsync(update
,fallbackType
):Promise
<AudioStatus
>
Updates the volume of the active stream by incrementing or decrementing.
If no stream is active, adjusts the volume of the specified fallback type.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
update
number
Type of update:
UP (0)
: Increase volume by one stepDOWN (1)
: Decrease volume by one step
fallbackType
Volume type to adjust if no active stream
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid parametersSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
updateVolumeAsync()
static
updateVolumeAsync(type
,volume
):Promise
<AudioStatus
>
Updates the volume of a specific audio type by incrementing or decrementing.
Requires privilege: com.amazon.audio.privilege.settings.control
Parameters
type
The audio type to adjust. See setVolumeAsync for types.
volume
number
Type of update:
UP (0)
: Increase volume by one stepDOWN (1)
: Decrease volume by one step
Returns
Promise
<AudioStatus
>
A promise that resolves to:
STATUS_NO_ERROR (0)
: SuccessSTATUS_BAD_VALUE (-2)
: Invalid parametersSTATUS_PERMISSION_DENIED (-9)
: Missing privilegeSTATUS_DEAD_OBJECT (-5)
: Server connection lost
Last updated: Sep 30, 2025