Part 3: Bueller, Bueller, Bueller…

Tom Hudson
thirteen23
Published in
6 min readJun 24, 2016

--

God bless the 1980s. Everything was so simple back then: Betamax, the Walkman, hamburger phones, acid wash jeans, and most importantly, John Hughes movies. The movies were incredible, no matter the genre. For instance, think about this slice of cinematic brilliance:

Back to the Future
Breakfast Club
Better Off Dead
Big Trouble in Little China
Caddyshack
Christmas Vacation
Coming to America
Die Hard
E.T.
Fast Times at Ridgemont High
Ferris Bueller’s Day Off
Ghostbusters
Raiders of the Lost Ark
The Lost Boys
Planes, Trains & Automobiles
Poltergeist
Pretty In Pink
Rambo
Real Genius
Revenge of the Nerds
Say Anything
Scarface
Sixteen Candles
Spaceballs
The Terminator
The Karate Kid
The Princess Bride
The Shining
Top Gun
Vacation
Weird Science

Above covers a large chunk of my pre-teen/teen indoor entertainment. So many great quotes from these movies, I can’t name them all here, but what I can do is create an Alexa skill that actually plays the clips!

If you haven’t read them already, you can catch up on this series by reading Part 1 and Part 2. TLDR: I’ve been teaching myself to write custom Alexa skills for the Amazon Echo and wanted to document the experience in a series of articles.

A while back Amazon added the ability to play sound clips via a skill through the Echo. I was talking to Doug Cook here at thirteen23, and we thought it would be fun to create a 1980s movie quote generator. Gather actual quotes from popular 80s movies and play the audio clip through your Echo. It became evident early on that this quote generator had to be called Bueller. And so it began.

We started out with the idea of just playing a random quote from a set of quotes across multiple movies, but ended up adding on the ability to grab a quote from a specific movie. For instance:

“Alexa, ask Bueller for a quote from Christmas Vacation.”

And then out ofyour Echo you hear something like this. Fun, right? The not-so-fun part is getting to this final stage. There are several complicated and/or laborious steps to take before everything is up and running.

Voice User Interface (VUI) diagram showing how Bueller works

Gathering Audio Clips

I found lots of places out on the web to grab audio clips from these movies. Although they look like websites that were coded from that same era, sites like moviewavs.com and reelwavs.com provided me with the audio snippets I was looking for. I grabbed at least 10 to 20 clips per movie which I felt was enough to give Bueller substance. Unfortunately this process took several hours of mind-numbing work: listening, clicking, downloading and organizing hundreds of sound clips into folders organized by movie title. From here I needed to make sure every audio clip would play on the Echo device.

In order for an audio clip to be played on an Amazon Echo, the clip has to adhere to certain criteria such as a bit rate of 48 kbps, a file type of MPEG v2, etc. The files I downloaded were all over the place, so I needed a way to bulk convert them. They were always in either .wav or .mp3 format which allowed for simple batch conversion using the command line tool FFmpeg. I used the same command for both files’ types, just switched out .wav with .mp3 and vice versa depending on the file extension for each file group. To do this, you open Terminal on a mac, go the folder containing .wav audio files, and run this command:

find . -name “*.wav” -exec bash -c ‘ffmpeg -i “{}” -ab 48k -c mp3 -ac 2 -ar 16000 -af volume=2 “new/${0/.wav}.mp3”’ {} \;

This script grabs all files with a .wav extension, converts them to the appropriate audio file that the Echo is able to play back, and copies them all to a folder called “new”. Now that I had all movie clips in an appropriate format, I needed somewhere to host them. Luckily AWS has just about any service you need, including S3, a secure media storage service!

Audio Clip Hosting

After creating all the new audio files in the proper format, I copied them onto S3 for storage and playback. This was just a matter of uploading all of these files onto the S3 instance, making sure they have the proper permissions (don’t forget this step!), and then you’re done.

Live Demo

Once all the audio was in place on Amazon S3, and the code was running on Amazon Lambda, I went ahead and tested out the skill. Below is the outtake for this video, where a completely unexpected quote from Planes, Trains and Automobiles came up. I honestly had no idea this clip was in there. Not sure how I missed that… ;)

Certification

As with any Amazon Alexa skill, what stands between your creative ideas and a publicly available skill is Amazon’s certification process. As I mentioned in part 2 of this series, they aren’t very forgiving or consistent when it comes to skill approval. Bueller didn’t get accepted due to Intellectual Property (IP) reasons:

Protecting intellectual property rights is important to us. Please provide documentation demonstrating that you have the right to use the Intellectual Property of multiple film studios (Universal Studios, etc.) The documentation must be either a confirmation letter from the intellectual property rights holder or a copy of the applicable license. Otherwise, please remove the audio clips of movies from your skill responses in order to no longer imply sponsorship.

Amazon is ultimately doing the right thing by rejecting Bueller based on protecting IP, but this is my third attempt at making modifications in order to convince Amazon to certify this skill. At this point I’m feeling dejected and ultimately starting to lose my religion in Alexa skill development.

So Now What?

It’s come to the end of my love affair with the Amazon Echo. There have been a number of hiccups, including certification woes, that has presently turned me off of the Amazon Echo platform. But I’ll bounce back. I’m excited to see what other companies have to offer. Apple is releasing an SDK for Siri, although limited to items like calling, messaging, and booking a ride. Google Home should be coming this fall and will have an advantage over the Echo: it will learn from you and improve in its responses. And Microsoft is also promising big things out of Cortana. So until then, now what? That’s easy. I’m going to step away from the computer, maybe watch a movie (Ferris Bueller’s Day Off?), and then move on to the next challenge.

thirteen23 is a digital product studio in Austin, Texas. We are an award winning team specializing in human-centered design. Together with our clients, we conceive, design, and develop intelligent software. Ready to build the next big thing? Let’s talk.

Find us on Facebook, Twitter, and Instagram or get in touch at thirteen23.com.

--

--

Tom Hudson
thirteen23

Tech Director at @thirteen23. I write about new and emerging platforms and other tech-related stuff.