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()
Registers a listener to be notified of audio focus changes.com.amazon.apmf.ISubscription*addFocusChangedListener(IFocusChangedListener*listener)
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()
Request audio focusvoidrequestAudioFocus(IAudioFocusAttributes*attributes)
Parameters
attributes
IAudioFocusAttributes* — Required
audio playback attributes for the focus being requested
Throws
AudioFocusDelayedError— on delay to grant audio focus SecurityError on failure
releaseAudioFocus()
void releaseAudioFocus()
Release audio focus

