AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Modules | Namespaces | Classes | Functions
Capability Agent for AVS Speaker 1.0 Interface

Capability Agent API and implementation for AVS Speaker 1.0 interface. More...

Collaboration diagram for Capability Agent for AVS Speaker 1.0 Interface:

Modules

 Unit tests for Speaker API Capability Agent.
 Capability Agent unit tests.
 
 Test mocks for speaker manager interfaces.
 Capability Agent unit tests.
 

Namespaces

 alexaClientSDK::speakerManager
 Speaker API Capability Agent Interface and Implementation.
 

Classes

struct  alexaClientSDK::speakerManager::SpeakerManagerConfigInterface
 Speaker manager configuration interface. More...
 
struct  alexaClientSDK::speakerManager::SpeakerManagerStorageInterface
 Speaker manager storage interface. More...
 
struct  alexaClientSDK::speakerManager::SpeakerManagerStorageState::ChannelState
 
struct  alexaClientSDK::speakerManager::SpeakerManagerStorageState
 Storage state for SpeakerManager. More...
 

Functions

std::shared_ptr< avsCommon::sdkInterfaces::SpeakerManagerInterfacealexaClientSDK::speakerManager::createSpeakerManagerCapabilityAgent (std::shared_ptr< SpeakerManagerConfigInterface > config, std::shared_ptr< SpeakerManagerStorageInterface > storage, std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender, std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier, const std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &endpointCapabilitiesRegistrar, const std::vector< std::shared_ptr< avsCommon::sdkInterfaces::ChannelVolumeInterface >> &volumeInterfaces={}) noexcept
 Creates speaker manager CA. More...
 
std::shared_ptr< SpeakerManagerStorageInterfacealexaClientSDK::speakerManager::createSpeakerManagerStorage (std::shared_ptr< avsCommon::sdkInterfaces::storage::MiscStorageInterface > storage) noexcept
 Adapt generic MiscStorageInterface into SpeakerManagerStorageInterface. More...
 
std::shared_ptr< SpeakerManagerConfigInterfacealexaClientSDK::speakerManager::createSpeakerManagerConfig () noexcept
 Creates configuration interface for speaker manager. More...
 

Detailed Description

Capability Agent API and implementation for AVS Speaker 1.0 interface.

See also
https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/speaker.html Speaker 1.0 Interface
alexaClientSDK::speakerManager
alexaClientSDK::speakerManager::test
Speaker Capability Agent Components

Function Documentation

◆ createSpeakerManagerCapabilityAgent()

std::shared_ptr<avsCommon::sdkInterfaces::SpeakerManagerInterface> alexaClientSDK::speakerManager::createSpeakerManagerCapabilityAgent ( std::shared_ptr< SpeakerManagerConfigInterface config,
std::shared_ptr< SpeakerManagerStorageInterface storage,
std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface contextManager,
std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface messageSender,
std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionEncounteredSender,
std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface metricRecorder,
const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &  shutdownNotifier,
const std::shared_ptr< avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > &  endpointCapabilitiesRegistrar,
const std::vector< std::shared_ptr< avsCommon::sdkInterfaces::ChannelVolumeInterface >> &  volumeInterfaces = {} 
)
noexcept

Creates speaker manager CA.

Method creates new speaker manager capability agent, adds supplied volume interfaces, and registers instance in capabilities registry and in shutdown manager.

Additional channel volume interfaces can be added after construction using public SpeakerManagerInterface methods.

Speaker manager groups all channels by type, and applies volume settings and configurations uniformly to all channels of the same type.

Speaker manager uses SpeakerManagerConfigInterface to load initial (bootstrap) platform configuration, and SpeakerManagerStorageInterface to store and load persistent settings. Those interfaces

Parameters
[in]configInterface to load platform configuration.
[in]storageInterface to load and store persistent configuration.
[in]contextManagerA ContextManagerInterface to manage the context.
[in]messageSenderA MessageSenderInterface to send messages to AVS.
[in]exceptionEncounteredSenderAn ExceptionEncounteredSenderInterface to send directive processing exceptions to AVS.
[in]metricRecorderThe metric recorder.
[in]shutdownNotifierFactory uses this interface to register for shutdown notifications.
[in]endpointCapabilitiesRegistrarFactory uses this interface to register capability.
[in]volumeInterfacesOptional vector of ChannelVolumeInterfaces to register. Additional interfaces can be added with SpeakerManagerInterface::addChannelVolumeInterface() calls.
See also
createSpeakerManagerStorage()
createSpeakerManagerConfig()
createChannelVolumeFactory()

◆ createSpeakerManagerConfig()

std::shared_ptr<SpeakerManagerConfigInterface> alexaClientSDK::speakerManager::createSpeakerManagerConfig ( )
noexcept

Creates configuration interface for speaker manager.

The method returns an interface that accesses configuration using ConfigurationNode facility. The returned object uses "speakerManagerCapabilityAgent" child and looks up the following keys:

  • "persistentStorage" – Boolean flag that indicates if persistent storage is enabled.
  • "minUnmuteVolume" – Minimum volume level for unmuting the channel. This setting applies to all channel types.
  • "defaultSpeakerVolume" – Default speaker volume.
  • "defaultAlertsVolume" – Default alerts volume.
  • "restoreMuteState" – Boolean flag that indicates if mute state shall be preserved between device reboots.

If AlexaClientSDKConfig.json configuration file is used, the example configuration may look like:

{
"speakerManagerCapabilityAgent": {
"persistentStorage": true,
"minUnmuteVolume": 10,
"defaultSpeakerVolume": 40,
"defaultAlertsVolume": 40,
"restoreMuteState": true
}
}
Returns
Interface to load initial configuration or nullptr on error.

◆ createSpeakerManagerStorage()

std::shared_ptr<SpeakerManagerStorageInterface> alexaClientSDK::speakerManager::createSpeakerManagerStorage ( std::shared_ptr< avsCommon::sdkInterfaces::storage::MiscStorageInterface storage)
noexcept

Adapt generic MiscStorageInterface into SpeakerManagerStorageInterface.

Method returns an adapter of SpeakerManagerStorageInterface to SpeakerManagerStorageInterface.

Parameters
[in]storageReference of MiscStorageInterface. This parameter must not be nullptr.
Returns
Storage interface or nullptr on error.

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0