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
Skip to main content
Audio Focus Manager allows the creation and destruction of Audio Focus Sessions. Specifically, it prevent multiple audio sources from playing at the same time by letting one audio source play normally while lowering the volume (also known as ducking), pausing, or stopping other audio sources.

Required services

The API requires declaration of the system audio service:

Types Used

Constructors

new AudioFocusManager()

new AudioFocusManager(): AudioFocusManager

Returns

AudioFocusManager

Properties

defaultFocusSession

static defaultFocusSession: AudioFocusSession = null

Methods

createAudioFocusSessionAsync()

static createAudioFocusSessionAsync(): Promise<AudioFocusSession> Creates a new . Each session can independently manage audio focus requests and callbacks. Multiple sessions can be created to manage different audio streams independently. Example use cases:
  • Different sessions for music playback and navigation
  • Separate session for voice assistant responses
  • Independent session for game audio

Returns

Promise<AudioFocusSession> Promise A promise that resolves to:
  • New object if successful
Or rejects with:
  • STATUS_NO_MEMORY (-1): Failed to allocate session
  • STATUS_NO_INIT (-3): Audio focus system not initialized
  • STATUS_DEAD_OBJECT (-5): Server communication error

Examples


destroyAudioFocusSessionAsync()

static destroyAudioFocusSessionAsync(sessionObject: AudioFocusSession): Promise<AudioFocusStatus> Destroys an existing audio focus session and releases all associated resources. This must be called when the session is no longer needed to free up system resources. Any active focus requests in this session will be automatically released. Important: Do not attempt to use the session object after destroying it.

Parameters

sessionObject
AudioFocusSession The session to destroy

Returns

Promise<AudioFocusStatus> Promise A promise that resolves to:
  • AUDIO_FOCUS_STATUS_NO_ERROR (0): Session destroyed successfully
  • AUDIO_FOCUS_STATUS_BAD_VALUE (-2): Invalid session object
  • AUDIO_FOCUS_STATUS_NO_INIT (-3): Audio focus system not initialized
  • AUDIO_FOCUS_STATUS_INVALID_OPERATION (-8): Session already destroyed

Examples


getDefaultAudioFocusSessionAsync()

static getDefaultAudioFocusSessionAsync(): Promise<AudioFocusSession> Gets the default audio focus session. This is a singleton instance that is used when an audio stream doesn’t explicitly specify a focus session. The default session is created on first access and persists until the application terminates. Important notes:
  • The default session is shared across all components using default focus
  • Focus changes in the default session affect all streams using it
  • For independent focus control, create dedicated sessions instead

Returns

Promise<AudioFocusSession> Promise A promise that resolves to:
  • The default AudioFocusSession instance Or rejects with:
  • STATUS_NO_MEMORY (-1): Failed to create default session
  • STATUS_NO_INIT (-3): Audio focus system not initialized
  • STATUS_DEAD_OBJECT (-5): Server communication error

Examples


getMajorVersion()

static getMajorVersion(): number Gets the major version number of the . Can be used for compatibility checking and feature detection.

Returns

number number The major version number of the module

getMinorVersion()

static getMinorVersion(): number Gets the minor version number of the . Can be used for compatibility checking and feature detection.

Returns

number number The minor version number of the module

getPatchVersion()

static getPatchVersion(): number Gets the patch version number of the . Can be used for compatibility checking and feature detection.

Returns

number number The patch version number of the module
Last modified on July 22, 2026