Grato por sua visita. Neste momento esta página está apenas disponível em inglês.

Alexa.StepSpeaker Interface

The Alexa.StepSpeaker interface provides directives that are used to adjust the volume, mute, and unmute an entertainment device. Implement this interface for devices that make incremental discrete step adjustments to volume, where the range of volume isn't known. For example, StepSpeaker can adjust volume by a step of 5, but can't adjust the volume to 50 percent. If your device can set the volume based on any continuous value in a range, implement the Speaker interface instead.

For the list of locales that are supported for the StepSpeaker interface, see List of Capability Interfaces and Supported Locales.

Utterances

When you use the Alexa.StepSpeaker interface, the voice interaction model is already built for you. The following examples show some customer utterances:

Alexa, lower the volume on the stereo.
Alexa, volume up 20 on the speakers.

After the customer says one of these utterances, Alexa sends a corresponding directive to your skill.

Directives

AdjustVolume

A request for a relative volume adjustment. The AdjustVolume directive is always relative to the current volume setting and can be positive to increase volume, or negative to reduce volume.

User: Alexa, lower the volume on device

User: Alexa, volume up 20 on device

Example Request:

{
  "directive": {
    "header": {
      "namespace": "Alexa.StepSpeaker",
      "name": "AdjustVolume",
      "messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
      "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token":"access-token-from-skill"
      },
      "endpointId": "<the identifier of the target endpoint>",
      "cookie": {
         
      }
    },
    "payload": {
      "volumeSteps": 20
    }
  }
}

Payload details

Field Description Type Required
volumeSteps A number that indicates how much the volume should be incremented or decremented. integer ranging from -100 to 100. Yes

SetMute

A request to mute or unmute an endpoint.

Example Request:

{
  "directive": {
    "header": {
      "namespace": "Alexa.StepSpeaker",
      "name": "SetMute",
      "messageId": "c8d53423-b49b-48ee-9181-f50acedf2870",
      "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token":"access-token-from-skill"
      },
      "endpointId": "<the identifier of the target endpoint>",
      "cookie": {
         
      }
    },
    "payload": {
      "mute": true
    }
  }
}

Payload details

Field Description Type Required
mute true to indicate the endpoint should be muted. False to indicate that the endpoint should be unmuted. boolean Yes

Properties and Events

For this capability, you must reply:

  • Synchronously, which means you send a Response to Alexa from the Lambda function.

When you send a Response, you should include the state of the interface properties in the context of the message.

Properties

There are no reportable properties currently defined for this interface.

Response

Send an Response event when AdjustVolume or a SetMute directive is successfully handled.

Response example

{
  "context": {
    "properties": [
    ]
  },
  "event": {
    "header": {
      "messageId": "30d2cd1a-ce4f-4542-aa5e-04bd0a6492d5",
      "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
      "name": "Response",
      "payloadVersion": "3"
    },
    "endpoint":{
       "endpointId":"appliance-001"
    },
    "payload":{ }
 }
}

ErrorResponse

You should reply with an error if you cannot complete the customer request for some reason. See Alexa.ErrorResponse for more details.

Additional Sample Code

See the sample request and response messages in the Alexa smart home GitHub repo:

StepSpeaker

Interface Description
Alexa.Speaker Messages for setting volume on a continuous range.