AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::mediaPlayer::android::AndroidSLESSpeaker Class Reference

#include <AndroidSLESSpeaker.h>

Inheritance diagram for alexaClientSDK::mediaPlayer::android::AndroidSLESSpeaker:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::mediaPlayer::android::AndroidSLESSpeaker:
Collaboration graph
[legend]

Public Member Functions

SpeakerInterface methods.
bool setVolume (int8_t volume) override
 
bool setMute (bool mute) override
 
bool getSpeakerSettings (SpeakerSettings *settings) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::SpeakerInterface
virtual ~SpeakerInterface ()=default
 

Static Public Member Functions

static std::unique_ptr< AndroidSLESSpeakercreate (std::shared_ptr< applicationUtilities::androidUtilities::AndroidSLESEngine > engine, std::shared_ptr< applicationUtilities::androidUtilities::AndroidSLESObject > outputMixObject, std::shared_ptr< applicationUtilities::androidUtilities::AndroidSLESObject > speakerObject)
 

Detailed Description

This class implements an android compatible speaker.

The implementation uses Android OpenSL ES to control speaker volume. We assume that OpenSL ES for Android is thread-safe as stated here .

Member Function Documentation

◆ create()

static std::unique_ptr<AndroidSLESSpeaker> alexaClientSDK::mediaPlayer::android::AndroidSLESSpeaker::create ( std::shared_ptr< applicationUtilities::androidUtilities::AndroidSLESEngine engine,
std::shared_ptr< applicationUtilities::androidUtilities::AndroidSLESObject outputMixObject,
std::shared_ptr< applicationUtilities::androidUtilities::AndroidSLESObject speakerObject 
)
static

Create AndroidSLESSpeaker.

Parameters
engineThe OpenSL ES engine that the speakerObject depends on.
outputMixObjectThe OpenSL ES output mix that the speakerObject depends on.
speakerObjectThe OpenSL ES object responsible for controlling the speaker output configurations.
Returns
An instance of the AndroidSLESSpeaker if successful else nullptr.

◆ getSpeakerSettings()

bool alexaClientSDK::mediaPlayer::android::AndroidSLESSpeaker::getSpeakerSettings ( SpeakerSettings settings)
overridevirtual

Return a SpeakerSettings object to indicate the current settings of the SpeakerInterface.

Parameters
[out]settingsA SpeakerSettings object if successful.
Returns
Whether the operation was successful.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeakerInterface.

◆ setMute()

bool alexaClientSDK::mediaPlayer::android::AndroidSLESSpeaker::setMute ( bool  mute)
overridevirtual

Set the mute of the speaker.

Parameters
muteRepresents whether the speaker should be muted (true) or unmuted (false).
Returns
Whether the operation was successful.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeakerInterface.

◆ setVolume()

bool alexaClientSDK::mediaPlayer::android::AndroidSLESSpeaker::setVolume ( int8_t  volume)
overridevirtual

Set the absolute volume of the speaker. volume will be [AVS_SET_VOLUME_MIN, AVS_SET_VOLUME_MAX], and implementers of the interface must normalize the volume to fit the needs of their drivers.

Parameters
volumeA volume to set the speaker to.
Returns
Whether the operation was successful.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SpeakerInterface.


The documentation for this class was generated from the following file:

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