Thomas W Bruner avatar image
Thomas W Bruner asked

Audio Player and protected S3

Do audio files destined for playback via the audio player need to be in a public bucket? I've seen a few examples that I'm unable to get working using a pre-signed URL. These examples all embed that media in SSML. As it is, testing the skill on a show, goes all the way to starting playback, the progress bar appears but the audio never plays. Tested the MP3 in a dummy skill and a public bucket and the it plays. The hosted skill having an issue reports: System exception encountered: undefined

Do I need to use a public bucket or am I doing something wrong with the PreSignedURL function? (PS: I've already added the global replace for the ampersand character.)

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

Andy Whitworth avatar image
Andy Whitworth answered

Hi Thomas, I am dubious about the reliability of using pre-signed URL's for Audio Player based skills but I think that the initial audio should at least start playing when using them. My issue is that, as the pre-signed URL is time limited to 60 seconds, then if the audio player requests the track data in chunks and a chunk is requested after 60s from the signed URL being generated then the chunk retrieval will fail. Also, if you're playing multiple tracks in your Audio Player skill then when you issue a request to start playing track #1, the audio player inteface will issue a PlaybackNearlyFinished request very early on in the track #1 playback. Your skill is then expected to enqueue track #2 at that point, ready for playing when track #1 ends. If track #1 lasts longer than 60s then the track#2 enqueued URL may expire before it is actually started.

So, in summary, I would not use pre-signed URLs with the audio player interface. I think there are too many issues for it to be reliable.

10 |5000

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