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 IAudioFocusSession

interface IAudioFocusSession
Extends com.amazon.apmf.IStandard Interface for encapsulating the Audio Focus Session

Methods

getSessionId()

i32 getSessionId()
Get audio focus session ID Audio focus session ID is used to link audio streams with this focus session. Audio streams with the same audio focus session will have the same focus session life cycle. Once this focus session grants the audio focus, these audio streams will grant focus too; If focus is lost, these streams will be affected together. The audio focus session ID is unique for a boot cycle.

Returns

i32 current focus session’s ID

addFocusChangedListener()

com.amazon.apmf.ISubscription* addFocusChangedListener(IFocusChangedListener* listener)
Registers a listener to be notified of audio focus changes.

Parameters

listener
IFocusChangedListener* — Required pointer to listener object

Returns

com.amazon.apmf.ISubscription* ISubscription pointer for the user to use when listener has to be unsubscribed

requestAudioFocus()

void requestAudioFocus(IAudioFocusAttributes* attributes)
Request audio focus

Parameters

attributes
IAudioFocusAttributes* — Required audio playback attributes for the focus being requested

Throws


releaseAudioFocus()

void releaseAudioFocus()
Release audio focus
Last modified on October 29, 2026