Alexa.EqualizerController Interface
Implement the Alexa.EqualizerController
interface in your Alexa skill so that users can set and adjust the equalizer bands and sound modes of a smart entertainment device. For more information about equalizers, see Equalization (audio) on Wikipedia. For more information about entertainment device skills, see Build Smart Home Skills for Entertainment Devices.
For the list of languages that the EqualizerController
interface supports, see List of Alexa Interfaces and Supported Languages.
Utterances
When you use the Alexa.EqualizerController
interface, the voice interaction model is already built for you. The following examples show some user utterances:
Alexa, set bass to -2 on the speakers.
Alexa, increase bass on the stereo.
Alexa, increase bass by 3 on the stereo.
Alexa, reset bass on the TV.
Alexa, reset equalizer on the speakers.
Alexa, set mode to movie on the TV.
After the user says one of these utterances, Alexa sends a corresponding directive to your skill.
Properties
The bands property
The Alexa.EqualizerController
interface uses the bands
property to represent the different bands, and the level of each, for the equalizer on a device. The bands
property is an array of band
objects.
Band object details
Field | Description | Type |
---|---|---|
name |
The name of the band. One of BASS , TREBLE , or MIDRANGE . |
String |
value |
The discrete frequency value (level) of the equalizer band. You specify the range of levels that your device supports in your discovery response. | Integer |
levelDirection |
When adjusting a band, the direction to adjust the level relative to the current setting. One of UP or DOWN . |
String |
levelDelta |
When adjusting a band, the amount by which to adjust the level relative to the current setting. If levelDelta , is not specified, adjust the level by the default amount. |
Integer |
Bands property example
This example reports the current value of 3 bands.
{
"name": "bands",
"value": [
{
"name": "BASS",
"value": 0
},
{
"name": "MIDRANGE",
"value": 3
},
{
"name": "TREBLE",
"value": 1
}
]
},
The mode property
The Alexa.EqualizerController
interface uses the mode
property to indicate the equalizer mode of the device, if one is set. The property is a string; valied values are MOVIE
, MUSIC
, NIGHT
, SPORT
, TV
.
Mode property example
{
"name": "mode",
"value": "MOVIE"
}
Discovery
You describe endpoints that support Alexa.EqualizerController
using the standard discovery mechanism described in Alexa.Discovery.
Set retrievable
to true for the properties that you report when Alexa sends your skill a state report request.
Set proactivelyReported
to true for the properties that you proactively report to Alexa in a change report.
Use SPEAKER
, TV
, STREAMING_DEVICE
, GAME_CONSOLE
, or other appropriate display category. For the full list of display categories, see display categories.
In addition to the usual discovery response fields, for EqualizerController
, include a configurations object that contains the following fields. You must specify at least one of bands
or modes
.
Field | Description | Type |
---|---|---|
bands |
The bands that your device supports. Omit this field if your device only supports pre-set equalizer modes. | Object |
bands.supported |
The names of the bands that your device supports. Valid values are BASS , TREBLE , and MIDRANGE . |
Array |
bands.range |
The minimum and maximum values for the range of band levels that your device supports. | Object |
modes |
The pre-set equalizer modes that your device supports. Omit this field if your device only supports bands. | Object |
modes.supported |
The names of the modes that your device supports. Valid values are MOVIE , MUSIC , NIGHT , SPORT , and TV . |
Array |
AddOrUpdateReport
message. For more information, see AddOrUpdateReport.Discover response example
The following example shows a Discover.Response
message for a television that supports the Alexa.EqualizerController
and Alexa.PowerController interfaces. For the full list of recommended interfaces for a television, see Smart Home Skill Device Templates.
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"payloadVersion": "3",
"messageId": "<message id>"
},
"payload": {
"endpoints": [
{
"endpointId": "<unique ID of the endpoint>",
"manufacturerName": "<the manufacturer name of the endpoint>",
"description": "Smart Television by Television Maker",
"friendlyName": "Living Room TV",
"displayCategories": ["TV"],
"cookie": {},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa.EqualizerController",
"version": "3",
"properties": {
"supported": [
{
"name": "bands"
},
{
"name": "mode"
}
],
"retrievable": true,
"proactivelyReported": true
},
"configurations": {
"bands": {
"supported": [
{
"name": "BASS"
},
{
"name": "MIDRANGE"
},
{
"name": "TREBLE"
}
],
"range": {
"minimum": -6,
"maximum": 6
}
},
"modes": {
"supported": [
{
"name": "MOVIE"
},
{
"name": "MUSIC"
},
{
"name": "SPORT"
}
]
}
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"retrievable": true,
"proactivelyReported": true
}
},
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
}
]
}
]
}
}
}
Directives
SetMode directive
Support the SetMode
directive so that users can set the audio mode of their devices.
The following example shows a user utterance:
Alexa, set mode to movie on the Living Room TV.
SetMode directive payload details
Field | Description | Type |
---|---|---|
mode |
The mode to set the device to. | String |
SetMode directive example
The following example illustrates a SetMode
directive that Alexa sends to your skill.
{
"directive": {
"header": {
"namespace": "Alexa.EqualizerController",
"name": "SetMode",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>",
"cookie": {}
},
"payload": {
"mode": "MOVIE"
}
}
}
SetMode response event
If you handle a SetMode
directive successfully, respond with an Alexa.Response event. In the context object, include the values of all relevant properties. You can respond synchronously or asynchronously. If you respond asynchronously, include a scope with an authorization token.
SetMode response event example
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.EqualizerController",
"name": "mode",
"value": "MOVIE",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EqualizerController",
"name": "bands",
"value": [
{
"name": "BASS",
"value": 0
},
{
"name": "MIDRANGE",
"value": 3
},
{
"name": "TREBLE",
"value": 1
}
],
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 500
}
]
}
}
SetMode directive error handling
If you can't handle a SetMode
directive successfully, respond with an Alexa.ErrorResponse event. Use the INVALID_VALUE
error type if the user requests a mode that your device does not support.
SetBands directive
Support the SetBands
directive so that users can set the equalizer bands on their devices.
The following example shows a user utterance:
Alexa, set bass to -2 on the Living Room TV.
SetBands directive payload details
Field | Description | Type |
---|---|---|
bands |
The bands, and level for each, to set on the device. | Array |
SetBands directive example
The following example illustrates a SetBands
directive that Alexa sends to your skill.
{
"directive": {
"header": {
"namespace": "Alexa.EqualizerController",
"name": "SetBands",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>",
"cookie": {}
},
"payload": {
"bands": [
{
"name": "BASS",
"value": -2
}
]
}
}
}
SetBands response event
If you handle a SetBands
directive successfully, respond with an Alexa.Response event. In the context object, include the values of all relevant properties. You can respond synchronously or asynchronously. If you respond asynchronously, include a scope with an authorization token.
SetBands response event example
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.EqualizerController",
"name": "mode",
"value": "MOVIE",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EqualizerController",
"name": "bands",
"value": [
{
"name": "BASS",
"value": -2
},
{
"name": "MIDRANGE",
"value": 3
},
{
"name": "TREBLE",
"value": 1
}
],
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 500
}
]
}
}
SetBands directive error handling
If you can't handle a SetBands
directive successfully, respond with an Alexa.ErrorResponse event. Use the INVALID_VALUE
error type if the user requests a value or band that your device does not support.
AdjustBands directive
Support the AdjustBands
directive so that users can adjust the equalizer bands on their devices, relative to their current settings.
The following example shows a user utterance:
Alexa, increase bass by 3 on the Living Room TV.
AdjustBands directive payload details
Field | Description | Type |
---|---|---|
bands |
The bands, and level adjustment for each, to change on the device. | Array |
AdjustBands directive example
The following example illustrates an AdjustBands
directive that Alexa sends to your skill.
{
"directive": {
"header": {
"namespace": "Alexa.EqualizerController",
"name": "AdjustBands",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>",
"cookie": {}
},
"payload": {
"bands": [
{
"name": "BASS",
"levelDelta": 3,
"levelDirection": "UP"
}
]
}
}
}
AdjustBands response event
If you handle an AdjustBands
directive successfully, respond with an Alexa.Response event. In the context object, include the values of all relevant properties. You can respond synchronously or asynchronously. If you respond asynchronously, include a scope with an authorization token.
AdjustBands response event example
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.EqualizerController",
"name": "mode",
"value": "MOVIE",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EqualizerController",
"name": "bands",
"value": [
{
"name": "BASS",
"value": 1
},
{
"name": "MIDRANGE",
"value": 3
},
{
"name": "TREBLE",
"value": 1
}
],
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 500
}
]
}
}
AdjustBands directive error handling
If you can't handle an AdjustBands
directive successfully, respond with an Alexa.ErrorResponse event. Use the INVALID_VALUE
error type if the user requests a band that your device does not support.
ResetBands directive
Support the ResetBands
directive so that users can reset the equalizer bands on their devices to their default values.
The following example shows a user utterance:
Alexa, reset bass on the Living Room TV.
ResetBands directive payload details
Field | Description | Type |
---|---|---|
bands |
The bands to reset on the device. | Array |
ResetBands directive example
The following example illustrates a ResetBands
directive that Alexa sends to your skill.
{
"directive": {
"header": {
"namespace": "Alexa.EqualizerController",
"name": "ResetBands",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>",
"cookie": {}
},
"payload": {
"bands": [
{
"name": "BASS"
},
{
"name": "MIDRANGE"
},
{
"name": "TREBLE"
}
]
}
}
}
ResetBands response event
If you handle a ResetBands
directive successfully, respond with an Alexa.Response event. In the context object, include the values of all relevant properties. You can respond synchronously or asynchronously. If you respond asynchronously, include a scope with an authorization token.
ResetBands response event example
{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.EqualizerController",
"name": "mode",
"value": "MOVIE",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EqualizerController",
"name": "bands",
"value": [
{
"name": "BASS",
"value": 0
},
{
"name": "MIDRANGE",
"value": 3
},
{
"name": "TREBLE",
"value": 1
}
],
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 500
}
]
}
}
ResetBands directive error handling
If you can't handle a ResetBands
directive successfully, respond with an Alexa.ErrorResponse event. Use the INVALID_VALUE
error type if the user requests a band that your device does not support.
State reporting
Alexa sends a ReportState
directive to request information about the state of an endpoint. When Alexa sends a ReportState
directive, you send a StateReport
event in response. The response contains the current state of all of the retrievable properties in the context object. You identify your retrievable properties in your discovery response. For details about state reports, see Understand State and Change Reporting.
StateReport response event example
{
"event": {
"header": {
"namespace": "Alexa",
"name": "StateReport",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.EqualizerController",
"name": "mode",
"value": "MOVIE",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.EqualizerController",
"name": "bands",
"value": [
{
"name": "BASS",
"value": 0
},
{
"name": "MIDRANGE",
"value": 3
},
{
"name": "TREBLE",
"value": 1
}
],
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 500
}
]
}
}
Change reporting
You send a ChangeReport
event to proactively report changes in the state of an endpoint. You identify the properties that you proactively report in your discovery response. For details about change reports, see Understand State and Change Reporting.
ChangeReport event example
{
"event": {
"header": {
"namespace": "Alexa",
"name": "ChangeReport",
"messageId": "<message id>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>"
},
"payload": {
"change": {
"cause": {
"type": "VOICE_INTERACTION"
},
"properties": [
{
"namespace": "Alexa.EqualizerController",
"name": "mode",
"value": "SPORT",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
}
]
}
}
},
"context": {
"properties": [
{
"namespace": "Alexa.EqualizerController",
"name": "bands",
"value": [
{
"name": "BASS",
"value": 0
},
{
"name": "MIDRANGE",
"value": 3
},
{
"name": "TREBLE",
"value": 1
}
],
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 0
},
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2017-02-03T16:20:50.52Z",
"uncertaintyInMilliseconds": 500
}
]
}
}