Building Cross-Platform Voice Apps With VOXA — Part 1
This is the first part of a series of five pieces, covering why it would be a good idea to use a cross-platform framework for your next voice app. I’ll also explain how to create a quick cross-platform game for Alexa and Google Assistant, taking advantage of the VOXA’s APIs.
It’s already been four years since the first development kit was released for one of the first voice platforms, Amazon Alexa. The platform has evolved hugely since then, and other competitors have joined the market — Google Assistant, Cortana, Siri, Samsung Bixby, and others.
The companies that created these platforms also built frameworks for developers to create applications for their platforms. Here’s dilemma number one for developers: if I want to create my skill in more than one platform: should I write my code in two or three different frameworks?
Let me tell you what I answered to myself: Octavio, please no! Don’t do that! Instead, use a framework that covers some or all of them.
That’s what I have done to develop skills for Alexa and actions for Google. I selected VOXA, a Node.js based framework that takes advantage of the state machine and MVC principles to develop voice applications for Alexa and Google Assistant. As a plus, it also has support for creating apps for Telegram and Facebook Messenger.
If you are a developer starting to dig into Alexa and Google Assistant voice apps, or a user experience designer with no development skills, or an experienced developer who has created skills/actions with other frameworks like the Alexa SDK or the Google Assistant SDK, you’ll find in VOXA an extraordinary tool to work collaboratively with your team.
Hence, I want to show you how you can easily build skills for Alexa and Google Assistant using VOXA. The framework also has a good command-line interface: VOXA-CLI, with a suite of useful tools to create a VOXA project, download utterances and responses, and many other things. If you’re working on a team with other developers and/or Voice User Interface (VUI) designers, and even with a Project Manager, all of them can collaborate for the VUI part of the application.
This is extremely useful when, for example, a VUI designer wants to add, modify, or delete utterances for your app’s intents, or want to modify a response. There could be many ways to get these changes from the VUI designer.
- Having a single file in your project, have the VUI designer make the changes to the file and get it back to put it up in the project.
- Uploading the code to a Git repository and have the VUI designer submit a Pull Request with the changes to the file.
As those two approaches are optional, the VUI designer may not know Git. Or they can make a mistake in the file. With VOXA, you create a spreadsheet, and have your VUI designer, Marketer, Project Manager or whoever is in charge of the VUI part, modify the spreadsheet and with a single command in your terminal, you can download their changes to create the responses file of the app, the interaction model for Alexa and the Dialogflow Agent for Google Assistant.
Here’s the use case. The game is called, Quick Maths: the user needs to do a math calculation as fast as possible — if they answer correctly they will get points as follows:
The user responds correctly in 1- 2 seconds: 10 points
The user responds correctly in 3 - 4 seconds: 8 points
The user responds correctly in 5 - 6 seconds: 4 points
The user responds correctly in more than 6 seconds: 1 point
The interesting part: if the user responds incorrectly, 2 points are deducted from their score. If they have 0 points, there’s no deduction.
It’s simple, right? Well, we’re going to make it a little more complex. We’re going to get the user’s profile information with VOXA:
- Get User Profile: we’ll need the user’s name to greet the user with their name and when they answer correctly. And we’ll need the user’s email to persist the information in our database. We’ll set up Alexa’s Account Linking and Google’s Sign-in to get this info.
Here’s the fun part: we’re going to add a competition feature to our game. The user with the highest score will be the winner of the monthly competition. We will show a leaderboard with the top 10 players. As you may guessing, we’ll add a subscription for this. The user will be charged $0.99 per month to continue participating in the competition.
Does this sound like monetization? Yes it does!
We’ll use Alexa’s ISP and Google Assistant’s Digital Goods for this feature. To make it more interesting, we’ll ask the user their permission to get their location so we can show where they’re from in the leaderboard.
The next four piece in this series will cover our journey on how to set up the project with VOXA. Here are the details:
This was the first piece in a series of articles where I will show you how easy is to create a voice application with VOXA, and how we can leverage its APIs to create more complex scenarios.
Thanks for reading! Be sure to check out the rest of the series.
Don’t throw garbage in the ocean!