Developing MP3 Alexa Skills
Why include MP3s in Alexa Skills?
MP3s are important in creating an Alexa Skill if you want a sound effect or specific voice to make your skill come alive. When I first started adding MP3 files to my Alexa Skills, Elizabeth Simpson was a tremendous mentor and teacher in this effort. Thank you Elizabeth! She created National Anthems, a game where users would listen to a short clip of a national anthem and then guess the country represented.
Check out a demo of National Anthems below.
I created a very simple skill on Alexa to play the sound of a can of cat food opening. Users could say, “Alexa, open cat food,” and Alexa would play my recording of opening a can of cat food. The most exciting part of my cat’s day are her meal times. This is also one of my most popular skills on Alexa; it turns out there are a few other cat pranksters out there.
Next, I worked with All-American and world-ranked track and field athlete, Tina Klein. I got the idea from Dwight Phillips, 2004 Olympic Gold medalist, who taught me that users want to hear audio coaching directly from the world athlete. I wanted to create an Alexa skill where aspiring runners could listen to Tina Klein, silver and bronze world champion in track and field. Tina recorded over 50 individual MP3s with various tips for running workouts, nutrition, gear, and more. Check out the Balanced Running Alexa skill here.
When I’m working with my enterprise clients, the MP3 recordings are taken to a new level. They hire voice actors and include special sound effects. Check out Baby Einstein Storytime optimized for Echo Show and Echo Spot.
How to Create MP3 Alexa Skills in 6 Easy Steps
- Record the sound. The easiest way is to record on your phone with an app such as Voice Recorder. The more sophisticated way is to utilize a microphone such as a SnowBall mic and record using Audacity.
- If the recording was not made in MP3 format, convert to MP3 format.
- Adjust the volume of your MP3 recording per Amazon’s stated best practices here.
- Convert the adjusted MP3 file into the correct bit rate of 48 kbps for Alexa according to this post.
- Upload the MP3 file(s) to an Internet-accessible HTTPS endpoint such as AWS S3.
- Note the unique URL of the MP3 and insert into your code using this SSML guide here.
There are quite a few limitations when including MP3s in Alexa skills. First of all, Alexa will not play MP3s longer than 90 seconds, and no more than 5 MP3 files in a row. The total duration of consecutive MP3 files cannot exceed 90 seconds.
What about Google Home? Last week I covered Google Home Dev 101 here. If you haven’t see that post, check that out first. The good news is that Google Home can play MP3s stored on AWS S3. The bad news is that the code syntax for playing MP3s on Google Home differs from Alexa, and a recode will be necessary.
Is it possible to play audio sounds longer than 90 seconds? Yes. We’ll cover audio streaming in a future article. If you need audio streaming info right now, check out this post from Amazon.