question

newuser-3756bfdc-28c8-4f37-b977-191114fe5979 avatar image

Unable to get audio ssml to work

As far as I know, I should be able to use the below SSML in the Amazon Alexa tester and have audio play back. However, I'm getting an error.

SSML:

<speak><audio src="https://s3-us-west-2.amazonaws.com/djc.media.pool.records/Library/libmp3lame2.mp3" /></speak>

ERROR:

Error: There was a problem when trying to retrieve the audio from https://s3-us-west-2.amazonaws.com/djc.media.pool.records/Library/libmp3lame2.mp3

I've also attempted to use the following site to help ensure the mp3 file is in the right format

https://www.jovo.tech/audio-converter

Could this be a permissions issue? Trying to figure out what's up.

What I'm trying to accomplish is to build up a playlist where Alexa will announce the next audio file that's going to play. I've attempted to use the audioplayer lib and was going quite well, but found that the audioplayer wouldn't allow Alexa to announce the next track. Instead it would only start playing the next audio file. So I decided to simply try using SSML directly by passing in the audio track that needs to play next along with some Alexa speech.

alexa skills kitaudioaudioplayer
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

Jenn@amazon avatar image
Jenn@amazon answered

Looks like the Audio file is too long.

I tested the Audio URL and received the following error in the CloudWatch Logs:

"request": {
        "type": "SessionEndedRequest",
        "requestId": "amzn1.echo-api.request.bd36718a-2e3a-434e-8332-ae4caee0723a",
        "timestamp": "2018-01-02T17:36:17Z",
        "locale": "en-US",
        "reason": "ERROR",
        "error": {
            "type": "INVALID_RESPONSE",
            "message": "Invalid SSML Output Speech for requestId amzn1.echo-api.request.7db5a314-3e90-4f6d-91c4-d64d275c9a0b. Error: The audio exceeds the allowed maximum length of 90000 milliseconds"
        }

Alexa will send back error information to Skills. To see the details, print out the Event JSON by adding:

console.log("===EVENT=== \n" + JSON.stringify(event));

to the exports.handler function:

exports.handler = function(event, context, callback) {
    console.log("===EVENT=== \n" + JSON.stringify(event));
    var alexa = Alexa.handler(event, context);
    alexa.APP_ID = APP_ID;
    alexa.registerHandlers(handlers);
    alexa.execute();
};
10 |5000

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