AVS Device SDK Interaction Model
This page documents any differences that exist between the interaction model implemented in different versions of the Alexa Voice Service (AVS) Device SDK and the Alexa Voice Service. For code samples and full implementation details, see the AVS Device SDK on GitHub or the AVS Device SDK API references.
Activity Focus Manager Library (AFML) Multi Activity
AFML Multi Activity enhances the behavior of a device so it can handle more than one Activity per Channel. This change means your device can switch back and forth between pre-determined activities without losing focus. AFML activities include Alexa speaking, music playing, alarms ringing, or other operations performed by the ChannelObserver
Interface.
The following example illustrates how AFML might work when a user plays music from their phone.
- A user asks Alexa to play music on Amazon Music.
- The AFML loads Amazon Music into the content channel and brings the music to the foreground. The music starts playing through the native media player loaded on the device, controlled by the
AudioPlayer
interface.
- The AFML loads Amazon Music into the content channel and brings the music to the foreground. The music starts playing through the native media player loaded on the device, controlled by the
- A few minutes later, the user switches the source of the music to play through Bluetooth. For example, through a connected phone.
- The AFML Multi Activity routes the music through the Bluetooth Interface. However, the instance of the native music player doesn't drop. Instead, it temporarily loses focus to a predetermined timeout of two minutes.
- After two minutes, one of the following actions occur.
- The Bluetooth Interface takes the primary focus and the
AudioPlayer
interface drops. - The
AudioPlayer
interface regains focus and the music automatically starts playing again.
- The Bluetooth Interface takes the primary focus and the
InterruptModel
InterruptModel interface is a new way to control how Channels interact with each other. Configuring the InterruptModel gives you more control over how events interact with your device. For example, you can specify that you want your device to duck in volume when it receives a custom notification alert.
Learn more about the implementation details in the InterruptModel Interface.
Last updated: Sep 28, 2021