question

newuser-d6fdb0f0-9c85-4d7d-bf8b-f69b3f0bbcbd avatar image

Unable to play audio in a response to a Touch Event

Hi,

First off I want to point out that my skill is able to properly play an audio file in a response to a audio intent using AudioPlayer. I learned the hard way that I had to return an empty empty response with shouldEndSession:true when the AudioPlayer.PlaybackStarted. This continues to work for me and has been for sometime.

Tonight I decided to give it a go with the TouchWrapper. I have it all wired up and working. However, when I my skill response with AudioPlayer.Play directive I get a failure callback very similar to the issue I came across when I did not know how to respond to the AudioPlayer.PlaybackStarted is returned:
'error': {'type': 'INVALID_RESPONSE', 'message': 'SpeechletResponse was null'}

For grins I instead had my skill respond without the AudioPlayer.Play directive and it can properly process my request.

Is there something I am doing wrong when responding back to a Alexa.Presentation.APL.UserEvent? Does it always expect a response that is NOT a AudioPlayer.Play? Or am I missing something in the AudioPlayer directive?

Thanks for your help,

Robb

Here it is:
{

  "version": "1.0",<br>  "sessionAttributes": "{sessionAttributes}",<br>  "response": {<br>    "outputSpeech": {<br>      "type": "SSML",<br>      "ssml": "<speak>Here is {title}.</speak> "},<br>    "card": {<br>      "type": "Standard",<br>      "title": "{title}",<br>      "text": "Here is reading {title}",<br>      "image": {<br>        "smallImageUrl": {logo}",<br>        "largeImageUrl": "{logo}"
	}<br>    },<br>    "reprompt": {<br>      "outputSpeech": {<br>        "type": "SSML",<br>        "ssml": "<speak>What audio would you like to listen to?</speak>"}<br>    },<br>    "directives": [<br>            {<br>                "type": "AudioPlayer.Play",<br>                "playBehavior": "REPLACE_ALL",<br>                "audioItem": {<br>                    "stream": {<br>                        "token": "{token}",<br>                        "url": "{url}",<br>                        "offsetInMilliseconds": 0}<br>                }<br>            }<br>        ],<br>    "shouldEndSession": true}<br>}
aplaudioplayer
1 comment
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 should also share that I am testing with an Alexa Spot.

0 Likes 0 ·

1 Answer

sungyoo avatar image
sungyoo answered

Hey Robb, are you using RenderDirective or ExecuteCommands by chance? Unfortunately those directives cannot be used in conjunction with a directive from Audioplayer interface at the moment. There are other interfaces listed in the tech doc that I linked above which are not compatible as well.

10 |5000

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