question

newuser-3dfe5d8e-c298-4bbf-aea1-b29592ad43d1 avatar image

Skills Kit not receiving directives

I'm working with the audioPlayer API. When I test, my lambda function seems to be returning the directives array with audio stream data, but I can't get my skill to receive it.

Lambda test responds with:

{
  "version": "1.0",
  "response": {
    "shouldEndSession": true,
    "card": {
      "type": "Simple",
      "title": "Playing Episode 140",
      "content": "Playing Episode 140"
    },
    "directives": [
      {
        "type": "AudioPlayer.Play",
        "playBehavior": "REPLACE_ALL",
        "audioItem": {
          "stream": {
            "url": "https://s3.amazonaws.com/<bucket>/<audio>.mp3",
            "token": "0",
            "expectedPreviousToken": null,
            "offsetInMilliseconds": 0
          }
        }
      }
    ]
  },
  "sessionAttributes": {
    "playOrder": [
      0,
      1
    ],
    "index": 0,
    "offsetInMilliseconds": 0,
    "loop": true,
    "shuffle": false,
    "playbackIndexChanged": false,
    "enqueuedToken": null,
    "STATE": "_PLAY_MODE"
  }
}

Actual response received by skill:

{
  "version": "1.0",
  "response": {
    "card": {
      "content": "Playing Episode 140",
      "title": "Playing Episode 140",
      "type": "Simple"
    },
    "shouldEndSession": true
  },
  "sessionAttributes": {
    "loop": true,
    "index": 0,
    "STATE": "_PLAY_MODE",
    "offsetInMilliseconds": 0,
    "shuffle": false,
    "playbackIndexChanged": false,
    "playOrder": [
      0,
      1
    ]
  }
}

My Skill Information > Global Fields > Audio Player = Yes

And the mp3 successfully plays when I return it in an <audio> tag within the output speech.

I cannot figure out what is misconfigured. I've even set up and tested with the exact example which Amazon links, to no avail: https://github.com/alexa/skill-sample-nodejs-audio-player

lambdaapiaudioresponsenode_js
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Nick Gardner avatar image
Nick Gardner answered

Are you doing this on a device or on the service simulator? If you're doing the latter can you please check if the same JSON is sent from an actual device test.

3 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

i've tested with both. where can i check the logs when i try with an actual device?

0 Likes 0 ·
Nick Gardner avatar image Nick Gardner ♦♦ newuser-3dfe5d8e-c298-4bbf-aea1-b29592ad43d1 ·

The logs won't be on the actual device, but you can create a logging function in your lambda to dump the entire request and response objects, which I find to be very helpful with debugging.

0 Likes 0 ·

great! thanks nick, i'll look into it.

0 Likes 0 ·