Building voice bots and games on devices includes voices that can seem "robotic" and potentially a little monotone. To simulate what a real human voice would sound like requires creating some excitement that puts emphasis on key words that are important to the dialog or game. That is now possible using the Alexa Skills Kit, just some advanced expertise in how to script the audio.Speechcons to the Rescue!
One of the recent advancements that Amazon added to the Speech Synthesis Markup Language (SSML) is the ability to add emotion. Rather than the normal pronouncing of words, Amazon has given developers the ability to have variations that bring Alexa's voice to life.
Here's a complete list of the more than 100 speechcons that are available, as well as a sound clip that plays what the voice will produce when using. Some of these aren't really even words, rather are slang or terms from popular culture (i.e. "booya" or "d'oh").Example for how to use
An example of how to use this can be found in a new skill that I published this week called Seventh Inning Stretch. It's a baseball simulation game that allows you to play baseball using your voice.
When you're getting ready to step up to hit the ball, I have Alexa say "Batter Up". Using the speechcon gives it emotion, more like what you would hear in an actual baseball game. Here's a sample.
The code to include the "Batter Up" instruction it is quite simple. In the appendix of the write-up is the full code for the function that uses it, but the syntax itself in SSML goes like this.
<say-as interpret-as=\"interjection\">batter up</say-as>
To make the game more interesting, I'm using several of these, and it's really an easy way to improve the voice user experience within a skill.