user3590313
user3590313

Reputation: 97

Alexa Skill: how to play mp3 longer that 4min

I've written a rather simple Alexa Skill that play pre-recorded tales for children, recorded by professional actors (long better than mechanical voice of Alexa). Everything works fine, you can chose which kind of story and the story get chosen randomly from an array.

The problem is that I am actually play mp3 using SSML and it that limits the audio file to max 4 minutes.

I could cut the longer stories in multiple .mp3 files, but I don't know how to create a "progressive reply".

Any suggestion?

Upvotes: 1

Views: 1046

Answers (1)

johndoe
johndoe

Reputation: 4387

There are certain limitations in embedding audio tag in SSML. The audio file cannot be longer than 240 seconds.

If your stories are longer than 4 mins consider upgrading it to an AudioPlayer response. Audio Player interface lets you to play longer mp3 audio files. With AudioPlayer interface you can play one story after the other, or repeat it.

The AudioPlayer interface provides directives and requests for streaming audio and monitoring playback progression. Your skill can send directives to start and stop the playback. The Alexa service sends your skill AudioPlayer requests to give you information about the playback state, such as when the track is nearly finished, or when playback starts and stops.

More on audio tag here
More on AudioPlayer intetrface here

Upvotes: 2

Related Questions