Amazon Alexa

Integration published by Jovo | 12,791 downloads

Build apps for Amazon's Alexa assistant platform

Audio Player Skills

AudioPlayer Skills can be used to stream long-form audio files like music or podcasts. The audio file must be hosted at an Internet-accessible HTTPS endpoint. The supported formats for the audio file include AAC/MP4, MP3, and HLS. Bitrates: 16kbps to 384 kbps. More information can be found here at the official reference by Amazon.

Get started by creating a new Jovo project with the alexa-audioplayer template:

Configuration

To be able to use the Alexa AudioPlayer, you need to enable the AudioPlayer interface for your Alexa Skill Project.

The alexa-audioplayer template already comes with the right configuration in its project.js file:

This will write the necessary information into the skill.json and deploy it to your Alexa Skill project with the following commands:

Alternatively, you can also go to the Alexa Developer Console and enable AudioPlayer in the interfaces tab:

Alexa Console: Enable Audio Player Interface

Audio Player Features

Play

Play a file. Speech will take place before the file begins to play.

play(url, token, playBehavior)

Play has the following parameters.

Name Description Value Required
url Specify the URL source of your audio must be HTTPS String YES
token An opaque token that represents the audio stream. This token cannot exceed 1024 characters. String YES
PlayBehavior Describes playback behavior. Accepted values:
REPLACE_ALL: Immediately begin playback of the specified stream, and replace current and enqueued streams.
ENQUEUE: Add the specified stream to the end of the current queue. This does not impact the currently playing stream.
REPLACE_ENQUEUED: Replace all streams in the queue. This does not impact the currently playing stream.
String NO - Defaults to REPLACE_ALL

Enqueue

Adds specified audio file to the queue. Remember that the URL must be HTTPS.

Name Description Value Required
expectedToken token of the currently playing stream String YES
url Specify the URL source of your audio must be HTTPS String YES
token An opaque token that represents the audio stream. This token cannot exceed 1024 characters. String YES

Stop

Stops the current file from playing.

Start Over

Starts the file specified by the url from the beginning.

Name Description Value Required
url Specify the URL source of your audio must be HTTPS String YES
token An opaque token that represents the audio stream. This token cannot exceed 1024 characters. String YES

Clear Queue

Use to clear all the queue or just the enqueue files.

Name Description Value Required
clearBehavior CLEAR_ALL - to clear everything
CLEAR_ENQUEUED- to clear just the queue.
String YES

Set Track Metadata

You can set track metadata that is used to show additional information for Alexa devices with a screen. Learn more about Audioplayer displays in the official reference by Amazon.

Name Description Value Required
title The title text to display String NO
subtitle Subtitle to display String NO
artwork URL for the image to display String NO
background URL for the background image to display STRING NO

For more information about the album artwork and the background image, refer to the official image guidelines by Amazon. Here are the recommended minimum sizes:

  • Artwork: 480 x 480 pixels
  • Background image: 1024 x 640 pixels

Audio Player Directives

Add the following to your handlers variable:

Playback Controller

PlaybackController requests are used to notify you about user interactions with audio player controls, e.g. touch controls on Alexa-enabled devices.

All these requests are mapped to built-in intents inside the PLAYBACKCONTROLLER state. You can respond to them with AudioPlayer directives, e.g. play, pause, etc.

Amazon Alexa Changelog

Jovo Marketplace | GitHub | npm

Current version might be higher than the latest changes displayed below because of updates of dependencies.

2021-10-27 [3.5.5]

2021-02-22 [3.5]

  • #901 Move setResponse from response to after.response middleware (@aswetlow)
  • #901 Route Alexa.Presentation.APLA.RuntimeError requests to ON_ERROR (@aswetlow)

2020-11-10 [3.2.1]

2020-08-21 [3.0.30]

3.0.17 (2020-05-13)

🐛 Bug fix

  • jovo-platform-alexa Fix http status in ReminderAPI

Committers: 1

3.0.13 (2020-05-04)

💅 Enhancements

  • jovo-platform-alexa #734 Add getPermissionIsCardThrown (@rmtuckerphx)
  • jovo-platform-alexa Add types for skill event body objects

Committers: 2

3.0.11 (2020-04-06)

  • Updated Typescript to 3.8.x
  • Updated Prettier to 2.x

Committers: 2

2.x

Find the 2.x changelog here.

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.