AudioFocusManager 1

The AudioFocusManager interface exposes directives and events for inter-process communication (IPC) client management of audio focus in the Alexa client reflected in AudioActivityTracker context for Alexa audio focus management.

{
    "namespace": "AudioFocusManager",
    "version": 1
}

Directives

Outbound messages from the Alexa client about the IPC client’s audio focus acquisition requests.

processChannelResult

Instructs the IPC client to handle the result of a acquireChannelRequest or releaseChannelRequest initiated by the IPC client.

Example message


{
    "header": {
        "version": 1
        "namespace": "AudioFocusManager",
        "name": "processChannelResult"
    },
        "payload": {
        "token": {{NUMBER}},
        "result": {{BOOLEAN}}
    }
}
 

Payload parameters

Parameter Description Type
token Token identifying the requestor. number
result Result of channel focus acquisition or release request. TRUE if successful. Boolean

processFocusChanged

Informs the IPC client of changes in audio focus for the given request token. The IPC client responds with a focusChangedReport event.

Example message

{
    "header": {
        "version": 1
        "namespace": "AudioFocusManager",
        "name": "processFocusChanged"
    },
        "payload": {
        "token": {{NUMBER}},
        "focusState": "{{STRING}}"
    }
}
 

Payload parameters

Parameter Description Type
token Token identifying the requestor. number
focusState Enumerated focus state for the associated audio channel. Valid values:
FOREGROUND
BACKGROUND
NONE

Events

Inbound messages from the IPC client about audio focus acquisition.

acquireChannelRequest

Send this event to request the Alexa client to acquire audio focus for the given channel with AVS interface and Audio ContentType association. The Alexa client responds with a processChannelResult directive.

Example message

{
    "header": {
        "version": 1
        "namespace": "AudioFocusManager",
        "name": "acquireChannelRequest"
    },
    "payload": {
        "token": {{NUMBER}},
        "avsInterface": "{{STRING}}",
        "channelName": "{{STRING}}",
        "contentType": "{{STRING}}"
    }
}
 

Payload parameters

Parameter Description Type
token Unique identifier for the focus request, used in the corresponding processChannelResult directive. number
avsInterface Name of the AVS Interface to acquire audio focus. string
Note: The value must be a valid AVS interface name that is supported by the Alexa client.
channelName Name of the audio channel for audio focus acquisition. Valid values:
Alerts
Communications
Content
Dialog
contentType Type of audio content. Valid values:
MIXABLE - content can attenuate to mix with other active content.
NONMIXABLE - content can't attenuate and should pause when other content is active.

releaseChannelRequest

Send this event to request the Alexa client to release audio focus for the given channel and AVS interface association. The Alexa client responds with a processChannelResult directive.

Example message

{
    "header": {
        "version": 1
        "namespace": "AudioFocusManager",
        "name": "releaseChannelRequest"
    },
    "payload": {
        "token": {{NUMBER}},
        "avsInterface": "{{STRING}}",
        "channelName": "{{STRING}}"
    }
}
 

Payload parameters

Parameter Description Type
token Unique identifier for the channel request, used in the corresponding processChannelResult directive. number
avsInterface Name of the AVS Interface from which to release audio focus. string
Note: The value must be a valid AVS interface name that is supported by the Alexa client.
channelName Name of the audio channel from which to release audio focus. Valid values:
Alerts
Communications
Content
Dialog

focusChangedReport

Send this event to inform the Alexa client of the IPC client’s receipt of the processFocusChanged directive.

Example message

{
    "header": {
        "version": 1
        "namespace": "AudioFocusManager",
        "name": "focusChangedReport"
    },
    "payload": {
        "token": {{NUMBER}}
    }
}
 

Payload parameters

Parameter Description Type
token The token from the corresponding processFocusChanged directive. number