question

Starfish Mint avatar image
Starfish Mint asked ·

Alexa not honouring REPLACE_ALL any more in audio api

Only realised while developing a new skill and it appears all other skills are broken as well. Even when we send new URL it continues to play old url.

alexa skills kitskillaudiovideo skill api
10 |2000 characters needed characters left characters exceeded

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

Starfish Mint avatar image
Starfish Mint answered ·

As a work around we are also sending playbackIndexChanged: true and that seems to do the trick and Alexa is playing the new stream. But this was all working earlier and it just changed without any warning and also index has not actually changed and this is just hacky way to make it work

1 comment
10 |2000 characters needed characters left characters exceeded

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

Hi. I'm new to ASK audio api. Could you tell me where should I set playbackIndexChanged? Should I place them inn session attributes when I send response to the directives? Thanks!

0 Likes 0 ·
Brian@Amazon avatar image
Brian@Amazon answered ·

Do you have some sample skillids where this is happening? Do you have before and after responses?

1 comment
10 |2000 characters needed characters left characters exceeded

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

Hi,

ID:amzn1.ask.skill.2f1858f7-293c-4d01-88cb-e66167c1379e

I have copied it all to this google doc document with sequence of request and response as number of character restriction won't let me add all requests. Hope it helps.

0 Likes 0 ·
Starfish Mint avatar image
Starfish Mint answered ·

Hi

ID:amzn1.ask.skill.2f1858f7-293c-4d01-88cb-e66167c1379e

1 Request:

================================================

{ version: '1.0',

session:

{ new: true,

sessionId: 'amzn1.echo-api.session.3792a526-b255-48d2-b361-d6e8e77c3d38',

application: { applicationId: 'amzn1.ask.skill.2f1858f7-293c-4d01-88cb-e66167c1379e' },

user:

{ userId: 'amzn1.ask.account.AE7XR27MIK4UCIRREFJWFARL2AATRV3N3FEIJRXZX5NQ4VJ5HNSZB2AWX5VSD2KUSIBINJFVBMBNIHN2ZQJXIHX6W3OJGB2FZTZCGDQI7VURAD7F35MKQX6JQ5SOB5YAP37AXA524G3BHOU5VMCUZRDTR2DQOHKXTYMSE6E3ZIUZB5EXBRNCT53SNZI3UDJY3V3D2AV56B4D5TY',

accessToken: 'ACCESS_TOKEN_REMOVED' },

attributes: {} },

context:

{ AudioPlayer:

{ offsetInMilliseconds: 140982,

token: '1',

playerActivity: 'STOPPED' },

System:

{ application: { applicationId: 'amzn1.ask.skill.2f1858f7-293c-4d01-88cb-e66167c1379e' },

user:

{ userId: 'amzn1.ask.account.AE7XR27MIK4UCIRREFJWFARL2AATRV3N3FEIJRXZX5NQ4VJ5HNSZB2AWX5VSD2KUSIBINJFVBMBNIHN2ZQJXIHX6W3OJGB2FZTZCGDQI7VURAD7F35MKQX6JQ5SOB5YAP37AXA524G3BHOU5VMCUZRDTR2DQOHKXTYMSE6E3ZIUZB5EXBRNCT53SNZI3UDJY3V3D2AV56B4D5TY',

accessToken: 'ACCESS_TOKEN_REMOVED' },

device:

{ deviceId: 'amzn1.ask.device.AFFSHGRE3T4B7M2MXVC6WW3LBJHJ4LSTQRCOCBEO5RLWPORDFXXS5QQ5PXT5UZKCXPLQ75OAVSJZCMC7YKAYN4Z2NE2Z6NFZGUDIJPNR5G7QVYMHLKBWVKWUQSJAWMR7TWDRHXLFVYN237IY5WABCQS53Y3A',

supportedInterfaces: { AudioPlayer: {} } },

apiEndpoint: 'https://api.eu.amazonalexa.com' } },

request:

{ type: 'LaunchRequest',

requestId: 'amzn1.echo-api.request.aba83ca1-c1e2-4e22-8873-8b58520216fe',

timestamp: '2017-08-19T11:04:04Z',

locale: 'en-GB' } }

1 Response:

============================================================================

{ version: '1.0',

response:

{ shouldEndSession: false,

outputSpeech:

{ type: 'SSML',

ssml: '<speak> You were listening to Pulp Fiction Twist Contest Dance Scene Would you like to resume? </speak>' },

reprompt:

{ outputSpeech:

{ type: 'SSML',

ssml: '<speak> You can say yes to resume or no for more options. </speak>' } } },

sessionAttributes:

{ index: 1,

STATE: '_RESUME_DECISION_MODE',

offsetInMilliseconds: 140982,

playbackIndexChanged: false,

playOrder: [ 0, 1 ],

token: '1',

playlist: 'old songs',

loop: true,

page: 0,

playbackFinished: false,

shuffle: false,

enqueuedToken: '0',

isSetup: true } }

User says He doesn't want to resume and asks for a new playlist. We refresh the data and session and send a new play directive as below:

============================================================================

{ version: '1.0',

response:

{ shouldEndSession: true,

card:

{ type: 'Standard',

title: 'Playing LONG DISTANCE BLUES',

image:

{ smallImageUrl: 'https://www.starfishmint.com/mp3/badge-108.png',

largeImageUrl: 'https://www.starfishmint.com/mp3/badge-512.png' },

text: 'Playing LONG DISTANCE BLUES' },

outputSpeech: { type: 'SSML', ssml: '<speak> Playing playlist jazz </speak>' },

directives:

[ { type: 'AudioPlayer.Play',

playBehavior: 'REPLACE_ALL',

audioItem:

{ stream:

{ url: 'WE_HAVE_PURPOSEFULLY_REPLACED_THIS_BUT_ORIGINAL_HAD_VALID_URL',

token: '0',

expectedPreviousToken: null,

offsetInMilliseconds: 0 } } } ] },

sessionAttributes:

{ index: 0,

STATE: '_PLAY_MODE',

offsetInMilliseconds: 0,

playbackIndexChanged: false,

playOrder: [ 0 ],

token: false,

playlist: 'jazz',

loop: true,

page: 0,

playbackFinished: false,

shuffle: false,

enqueuedToken: null,

isSetup: true } }

At this time Alexa continues to play the old song but if I say next it plays the song in above directive.

10 |2000 characters needed characters left characters exceeded

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

Dmitry Kalashnikov avatar image
Dmitry Kalashnikov answered ·

Any progress on this issue?

10 |2000 characters needed characters left characters exceeded

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