This is an old revision of the document!
Table of Contents
Creating an Alexa Skill to Play a Music File
Author: Santiago Ricoy Email: ricoys1@unlv.nevada.edu
Date: Last modified on 12/28/16
Keywords: alexa skill tutorial voice audio playback alexa sdk
This picture shows part of the Amazon Developer console, which allows you to use many items offered by Amazon to developers; in this case, testing the voice-controlled side of an Alexa skill. We need to understand how to stream files through our Alexa-enabled device. Solving this is to some degree is important because it demonstrates the ability to fetch files from the web with the Alexa Voice Service (AVS), which implies it can be used to manipulate and control other items in the cloud, and connected devices. This tutorial shows you how to set up a lambda function that talks to the voice-operated end of an Alexa skill. It takes approximately 1.5 hours to complete.
Motivation and Audience
This tutorial's motivation is to spark innovation in attendees of the IEEE Winter School. The tutorial assumes the reader has the following background and interests:
* Can sign up and learn to use basic AWS services
* Can navigate Object Oriented code
* Additional background needed may include prior exposure to javascript and node.js
* This tutorial may also attract readers who are interested in voice recognition
The rest of this tutorial is presented as follows:
Required Items
To complete this tutorial, you'll need the following items:
- The files within this zip file Coming soon
- Computer with Internet access
- Wifi internet access (if using an Amazon device)
- Node.js runtime installed
- Text editor (Atom was used for this)
- Optionally: An Alexa-enabled device
NOTE: The Echo Dot is what was used for the creation of this tutorial (the most convenient option, if not the least expensive). Using a physical device is optional, because skills can be tested without a physical device. However, since the testing environment gives no audio output, we would not be able to confirm that music is actually being streamed, let alone that the correct file is being played, without a device.
PART NAME/DESCRIPTION | VENDOR | VENDOR Number or URL | PRICE | QTY |
---|---|---|---|---|
Amazon Echo Dot | Amazon.com | https://www.amazon.com/All-New-Amazon-Echo-Dot-Add-Alexa-To-Any-Room/dp/B01DFKC2SO/ref=sr_1_2?ie=UTF8&qid=1483065428&sr=8-2&keywords=echo | $49.99 | 1 |
Construction
Background
The Alexa voice service (AVS), by Amazon, has a developer package called the Alexa SKills Kit (ASK) that allows users to create new skills for Alexa-enabled devices. All Alexa-enabled devices can perform functions with these skills. The voice-recognition software is taken care of when using this, leaving the developer to focus on designing the actual given commands.
Method
Most Alexa skills are made up of a skill created with the Alexa Skills Kit in the AWS Developer Console and an AWS Lambda function that the skill sends its requests to.
Here we'll initiate the two parts:
Step 1:
If you do not already have one, create an Amazon Developer Account and sign in to the Amazon Developer Console.
Step 2:
If you do not already have one, create an AWS Account and sign into the AWS Management Console.
Step 3:
From the Amazon Developer Console dashboard, click on the “Alexa” tab and then “Get Started” with the Alexa Skills Kit.
Click “Add a new skill”. This will put you into the sequence for configuring your Alexa skill.
Programming
A link to the source code can be found <provide URL to your code, probably saved in this DASL Wiki>.
The goal of the code is <brief explanation>. It works in the following way
<!- Insert a snippet of your code here. Try to keep to less than 0.5 page long –>
The snippet above serves to <fill in the blank>. It does this by <fill in the blank>.
<!- Insert another snippet of your code here. Try to keep to less than 0.5 page long –>
Next, the code does <fill in the blank>. It does this by <fill in the blank>.
Final Words
This tutorial's objective was to <fill in the blank>. Complete <choose: construction details, source code and program descriptions> for <fill in the blank>. Once the concepts were conveyed the reader could <fill in the blank>.
Speculating future work derived from this tutorial, includes <fill in the blank>. In the big picture, the problem of <fill in the blank> can be solved with this tutorial.
For questions, clarifications, etc, Email: paul.oh@unlv.edu