Set Up the AVS Device SDK on Windows 10


The following guide provides step-by-step instructions to set up the Alexa Voice Service (AVS) Device SDK on Windows 10 64 bit. This includes installing, building, authorizing, and using the Alexa Voice Service (AVS) Device SDK. When finished, you have a working sample app to test interactions with Alexa.

Before you get started, see the SDK overview page to establish a working knowledge of how the SDK works.

You complete the following activities in this tutorial:

  1. Register an Alexa Built-in product with the Amazon developer portal.
  2. Install and configure AVS Device SDK dependencies on Windows.
  3. Build the SDK and run the AVS sample app.

Prerequisites

Required hardware

External speaker or headset - Your audio source.

Required software

  • Windows 10 64 bit
  • AVS Device SDK 1.17.0 or higher - The instructions in this tutorial download the latest version of the SDK that's available.
  • Minimum dependencies – The Alexa app relies on external libraries to compile. For more details about the external libraries you must install, see AVS Device SDK Dependencies.

Step 1: Register your product with Amazon

Before you install the AVS Device SDK, you must Register an AVS Product and Create a Security Profile. After you register your device, you download a config.json file that contains your client ID and client secret. The client ID and client secret authorize your device, so you can retrieve access tokens from AVS. Your config.json file facilitates the authorization calls between your device and AVS.

Step 2: Set up your Windows environment

You must set up MSYS2 (64-bit) and Pacman before the AVS Device SDK runs on Windows. MSYS2 is a software distribution and building platform for Windows.

This guide presumes that you use the MING64 home directory as your starting point – C:/msys64/home/<user_name>. If you choose to use different folder names, update the home commands throughout the guide accordingly.

  1. Download and run the MSYS2 (64-bit) installer. This installs three different shells: MSYS2, MinGW32, and MinGW64. After the installation finishes, open the MinGW64 shell. You should be in the home directory.

  2. Update the Pacman package list included with MSYS2.

     pacman -Syu
    
  3. Finish updating Pacman. Close and reopen MinGW64, and run this command.

     pacman -Su
    

Step 3: Download the configuration scripts

Open the MinGW64 shell and run these three commands in a single block statement. This downloads three AVS Device SDK configuration scripts into your MinGW64 home directory. These scripts are later used to download and authorize the AVS Device SDK and sample app.

 wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/setup.sh \
 wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/genConfig.sh \
 wget https://raw.githubusercontent.com/alexa/avs-device-sdk/master/tools/Install/mingw.sh

(Optional) Step 4: Enable Webvtt captions

To enable captions in your build

  1. Clone the Alexa WebVTT project from the following Alexa WebVTT GitHub repository. Save the files somewhere convenient, such as in a directory inside your SDK project.
  2. Follow the Windows 10 instructions on GitHub to generate a .dll file for the WebVTT library.
  3. Open the AVS Device SDK setup.sh script file in a text editor.
  4. Find the CMake command under the BUILDING SDK section and add the following flags.

     -DCAPTIONS=ON
     -DLIBWEBVTT_INCLUDE_DIR=<path to your WebVTT include dir>
     -DLIBWEBVTT_LIB_PATH=<path to the WebVTT .dll that you generated by following the instructions on the WebVTT github page>
    

    Make sure you update the path parameters to point to the same locations that you downloaded the WebVTT files to in step one and two of these instructions. For example, /home/alexa/webvtt/build/src/webvtt/libwebvtt.dll and /home/alexa/webvtt/include/.

Step 5: Download the SDK and dependencies

  1. Move your config.json file to your MinGW64 home directory – C:/msys64/home/<user_name>.

  2. Edit the setup.sh by replacing git clone --single-branch $CLONE_URL avs-device-sdk with git clone -b v1.26.0 --single-branch $CLONE_URL avs-device-sdk.

  3. Open the MinGW64 shell and run the setup.sh file using your config.json file and a device serial number (DSN) as arguments.

    If these fields are blank, the SDK generates a default value of 123456.

     bash setup.sh config.json -s 998987
    
  4. Agree to the AVS Device SDK terms and Terms and Agreements.

    This downloads the SDK, sample app and any required dependencies. It might take a few minutes to finish downloading all the assets.

Step 6: Run and authorize the sample app

  1. Start the sample app by double clicking the startsample.bat file located in C:/msys64/home/<user_name>
  2. Wait for the sample app to display the following confirmation message.

     ##################################
     #       NOT YET AUTHORIZED       #
     ##################################
     ################################################################################################
     #       To authorize, browse to: 'https://amazon.com/us/code' and enter the code: {XXXX}       #
     ################################################################################################
    
  3. Use a browser to navigate to the URL specified in the message from the sample app.
  4. If requested, authenticate using your Amazon user credentials.
  5. Enter the code specified in the message from sample app.
  6. Select Allow.
  7. Wait for the sample app to report that it's authorized and that Alexa is idle.

    You are now ready to talk to Alexa. The next time you start the sample app, you don't have to go through the authorization process again. If you close the sample app, start it again by rerunning the startsample.bat file.

     ###########################
     #       Authorized!       #
     ###########################
     ########################################
     #       Alexa is currently idle!       #
     ########################################
    

Step 7: Use the sample app

Start the sample app by double clicking the startsample.bat file located in C:/msys64/home/<user_name>

Now that you have a working sample app, try an interaction with Alexa. For more details about how to interact with Alexa, see Use the sample app.

Optional configurations

To run the sample app manually

Open the MinGW64 shell and run the following commands:

cd <msys64_installed_path>/alexa_sdk/build/bin
./SampleApp.exe ../Integration/AlexaClientSDKConfig.json DEBUG9

To run the sample app using the Windows command line

  1. Add <msys64_installed_path>/mingw64/bin to your Windows path.
  2. Use mingw32-make.exe instead of make.

To build the SDK after making custom changes

Open the MinGW64 shell, and run make inside of the alexa_sdk/build folder.

Troubleshooting

See the Troubleshooting Guide.


Was this page helpful?

Last updated: Oct 25, 2022