question

DevCoder avatar image
DevCoder asked ·

Alexa hosted skill playing mp3 file from S3 not working

I'm trying to play an mp3 file uploaded to the Media folder of my Alexa Hosted skill's S3 bucket, but it throws an error telling me my SSML isn't properly formatted. The issue is actually coming from using the Util packages getSignedUrl method (which I use to get the signed url for my object).

I've seen other posts suggesting to make the url public in S3, but even this gives me a permission error on upload if I do it there, or it also tells me I don't have permission if I try to change it after uploading a file.

The error I get from the intent when I try to play the file in question is:


Invalid SSML Output Speech for requestId amzn1.echo-api.request.bdc974b8-525d-4d4b-a6c0-0bbdef261a21. Error: Fatal error occurred when processing SSML content. This usually happens when the SSML is not well formed. Error: Unexpected character '=' (code 61); expected a semi-colon after the reference for entity 'X-Amz-Credential'\n at [row,col {unknown-source}]: [1,178]

As you can see it's actually the signedUrl that seems to be causing an issue.


Anyone got any ideas?


I realise I'd posted something similar before https://forums.developer.amazon.com/questions/202618/alexa-hosted-skill-not-playing-audio-file-from-s3.html and not realised there had been responses. However the fix posted in the post using Escape doesn't work.


alexa skills kitaudiossmlhosted skill
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.

Chinmay avatar image
Chinmay answered ·

I got permission error sometimes back in alexa hosted skill while developing a skill with APL. Here is what i did,

  1. Logged into S3 as AWS user (Not default user provided by Alexa developer console)
  2. Uploaded the bucket item and made it public. [My skill used image in public domain ]
  3. Used the url given in the skill


May not be a great suggestion, but still you can cross check:

SSML response in test console manually.


Consider if it works, Ignore if irrelevant

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.

Yeah I created a separate S3 bucket with a normal account and made it public and that worked, but it seems to fly in the face of of having the hosted bucket, especially as they provide the utils and Amazon's own docs have an (albeit image) example where it uses the preSignedUrl method to retrieve it for display. Plus it means I could incur costs that would otherwise have been free as an Alexa Hosted skill.

0 Likes 0 ·
Dzefo avatar image
Dzefo answered ·
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.