Developing for Amazon Alexa

This summer when I spoke at PixelPop Festival, I went to a talk by Mike Lee about developing games for Amazon Alexa. He was working for a game studio that created a sort of “choose your own adventure” interactive radio play. Silvia and I have been writing a series of radio plays, so I was intrigued by the idea and decided to learn how to develop for Alexa.

I started researching, and quickly learned that most people start out with a tutorial to create a trivia game skill. This tutorial takes you through the whole process from getting your dev environment set up to publishing your skill in the Alexa Skill Store. Theoretically the only coding you need to do is to write your own questions in a big ol’ JavaScript object, although I ended up doing a bit more customization.

I needed a topic for my trivia game. Naturally I chose Sherlock Holmes, since I had just finished reading the whole Holmes canon. The tutorial suggested that the most successful trivia skills have over 100 questions, so I got to work writing them. This probably took up the biggest chunk of time of the whole project. It was a challenge to not only come up with 100 questions, but three incorrect answers for each question.

Holmes uses a magnifying glass to investigates the word RACHE written on the wall.

Illustration By D. H. Friston from A Study in Scarlet

The next challenge was pronunciation. Alexa was pronouncing stuff weirdly, or just using the wrong sense of the word, as in “His Last Bow.” Alexa supports Speech Synthesis Markup Language (SSML), which I used to correct most of this.
<phoneme alphabet="ipa" ph="mʌnki">monkey</phoneme>

<w role="amazon:SENSE_1">Bow</w>
But then there were words from other languages, like the famous German word RACHE written in blood on the wall in A Study In Scarlet. Alexa (or maybe SSML in general?) does not support the use of German phonemes within English language text. So I had to approximate it as best I could with English phonemes, which, as it turns out, is not very accurate.

It was actually pretty fun to figure out how words are supposed to be pronounced that I had only read and never heard. There are some things that Doyle just made up, like The Mazarin Stone. My go-to source for pronunciation was the Jeremy Brett Granada series, in which I learned, among other things, that Mazarin is pronounced as in the French. I was surprisingly able to recreate this pronunciation fairly well with English phonemes.

Another issue I had was Alexa overdoing the upward inflection at the end of the sentence to indicate questions. I tried to fix this by replacing the question marks with periods. This fixed the inflection, but created another very curious issue that I tried to debug for hours to no avail. For some reason if there are any periods in the text of the question, instead of reading the four multiple choice answers, Alexa will say the letters “Q” “U” “E” and “S” in a random order. The bug was reported here, but the issue was closed without being fixed. Hopefully it will get some attention from the tutorial developers.

Overcoming the pronunciation issues and a few other minor bugs, I published Sherlock Holmes Trivia in the Alexa Skill Store in November, and so far I’ve had almost 250 unique users. I’d eventually like to add some more features, like different levels of difficulty. It is a rather challenging quiz, but I hope you’ll give it a try!