AVS Device SDK Interaction Model

This page documents any differences that might 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.

  1. 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.
  2. 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.
  3. 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.

Ducking

Ducking allows on-device content to attenuate the volume of other channels when necessary – If necessary, you can disable it during the initialization of the InterruptModelConfiguration. If you disable ducking, content pauses instead of attenuating the channel volume.

Enable Ducking by calling alexaClientSDK::afml::interruptModel::InterruptModelConfiguration::getConfig(bool) in the sample app. If you disable ducking, all mixing behaviors set to pause.

To learn more about the implementation details, see the InterruptModel Interface.

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.