question

Ranjit R. avatar image
Ranjit R. asked

How to play an mp3 file from an offset in Amazon Echo

Is it possible to tell Amazon Echo (using SSML) to play an mp3 file from a specific offset? I'm trying to implement a pause and resume feature for an mp3 file playing on the Echo.
alexa skills kitsubmission testing certification
10 |5000

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

Eric@Amazon avatar image
Eric@Amazon answered
I'm not sure what you're trying to do. Is this in the context of a skill?
10 |5000

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

Ranjit R. avatar image
Ranjit R. answered
It is. I'm playing an mp3 file and want to allow the user to pause and resume the file that is being played.
10 |5000

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

Eric@Amazon avatar image
Eric@Amazon answered
Unfortunately, that ability does not currently exist. I'll forward the feature request to the relevant team!
10 |5000

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

Ranjit R. avatar image
Ranjit R. answered
A related question I had was, is there a file size limit on the mp3 file that can be played? I get a response size exceeded 1 MB error when I try to play an mp3 file bigger than a meg. This is quite limiting for me.
10 |5000

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

jjaquinta avatar image
jjaquinta answered
You can check the doc to be certain. But I'm pretty sure you are right, it's about 1 meg. But I've never seen anyone hit that, since you are also limited to 90 seconds. Just out of curiosity, what are you playing that is less than 90 seconds but more than 1 meg?!?
10 |5000

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

Ranjit R. avatar image
Ranjit R. answered
An audio book chapter :)
10 |5000

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

jjaquinta avatar image
jjaquinta answered
Unless it's a pretty unusual audio book, I would think your chapters would be more than 90 seconds each.
10 |5000

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

Ranjit R. avatar image
Ranjit R. answered
That's true. My books are broken down by chapters and each chapter is a few MBs in size. I could take a chapter mp3 and break it into less than 1 MB segments but I don't know of a way to provide Alexa with a list of mp3s and have it play them back to back, so the user doesn't see pauses in between. Does that make sense, can you suggest any other ideas?
10 |5000

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

jjaquinta avatar image
jjaquinta answered
You really need to read the SSML section and understand the limits of what Alexa lets you do. You cannot play a sound file larger than 1MB. You cannot play a sound file longer than 90 seconds. You can only play up to five clips per response. So, basically, you cannot create the skill you have designed. If you already have an audio book, why don't you just upload it to Audible and let people play it via the normal features in the Echo? If all you are doing is trying to sell an audio book for people to listen to on the Echo, that's your best bet. But there are some additional limitations to this approach. (I looked it in the context of releasing fictional tie-in stories for StarLanes.) * You have to sell it. Audible will not let you choose the price. You have to let Amazon choose the price. And they won't choose $0. * If this is related to a skill, you can't tie it in. I.e. you can't launch it from your skill. Nor can you entitle a skill user to a copy of it. * You have to go with Audible. You can't use Podiobooks, for example. (Where I've published before.) Amazon have not tied The Echo into any other service. These were deal-breakers for me. But your use case may be different.
10 |5000

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

Ranjit R. avatar image
Ranjit R. answered
Thanks for your response! So am trying to build an Alexa audio book skill for the thousands of free audio books available on https://librivox.org/. Since I have access to their database (which is all public btw), I can expose their audio books through Alexa and provide yet another means for people to enjoy those free audio books (in addition to the librivox website and their Android app) I can build interesting search features like searching by genre, playing a random book (and eventually even a recommendation system based on what people have played in the past). I don't see any association for this skill with Audible.com because as I understand audible needs a subscription and does not have a way for people to upload free audio books to serve them out via audible.com. The Echo has native support for audible, so it's technically possible for Alexa to play larger mp3 files, but I'd guess this capability isn't exposed for developers yet.
10 |5000

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