0

I am trying to play an audio in my alexa skill with standard card type. This is my json output for Alexa.

{ 
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "type": "PlainText",
      "text": "Your Audio will start playing now"
    },
    "card": {
      "type": "Standard",
      "title": "Audio One Sample Title",
      "text": "Audio One Sample Description",
      "image": {
        "smallImageUrl": "https://image_url.jpeg",
        "largeImageUrl": "https://image_url.jpeg"
      }
    },
    "directives": [
      {
        "type": "AudioPlayer.Play",
        "playBehavior": "REPLACE_ALL",
        "audioItem": {
          "stream": {
            "url": "https://audio_url.mp3",
            "token": "sample_token_1",
            "offsetInMilliseconds": 0
          }
        }
      }
    ],
    "shouldEndSession": true
  }
}

I can see this card title and description getting displayed on my alexa spot and alexa show, but this title and description disappear once the audio starts. Is there something else I have to add to this json so that these titles remains on the screen even when the audio is playing.

Nidhin S G
  • 1,685
  • 2
  • 15
  • 45
  • 1
    In your request JSON, try replacing `"playBehavior": "REPLACE_ALL"` to `"playBehavior": "REPLACE_ENQUEUED"` –  Dec 13 '18 at 09:55
  • I am not able to play the audio when i replaced behaviour to REPLACE_ENQUEUED. The audio just don't play. Session ends with speech provided in the above json. – Nidhin S G Dec 13 '18 at 11:07
  • Give this `"playBehavior": "ENQUEUE"` a final try, implementation can be seen here - https://developer.amazon.com/docs/custom-skills/audioplayer-interface-reference.html#play –  Dec 13 '18 at 19:33

0 Answers0