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

#include <AndroidSLESEngine.h>

Inheritance diagram for alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine:
Collaboration graph
[legend]

Public Member Functions

std::unique_ptr< AndroidSLESMicrophonecreateAndroidMicrophone (std::shared_ptr< avsCommon::avs::AudioInputStream > stream)
 
std::unique_ptr< AndroidSLESObjectcreateAudioRecorder ()
 
void createAudioRecorder (SLObjectItf &recorderObject)
 
std::unique_ptr< AndroidSLESObjectcreatePlayer (SLDataSource &source, SLDataSink &sink, bool requireEqualizer) const
 
std::unique_ptr< AndroidSLESObjectcreateOutputMix () const
 
 ~AndroidSLESEngine ()
 

Static Public Member Functions

static std::shared_ptr< AndroidSLESEnginecreate ()
 

Detailed Description

Class that represents the OpenSL ES engine object + interfaces.

The engine is used to create other OpenSL ES objects, and each application should only have one engine. Furthermore, the engine should be the first OpenSL ES object to be created and the last to be destroyed.

The create method ensures that the application has only one engine.

Constructor & Destructor Documentation

◆ ~AndroidSLESEngine()

alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine::~AndroidSLESEngine ( )

Destructor.

Member Function Documentation

◆ create()

static std::shared_ptr<AndroidSLESEngine> alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine::create ( )
static

Creates an AndroidSLESEngine. This method will only succeed if there is no other engine alive.

Returns
A shared pointer to an AndroidSLESEngine object if succeeds; otherwise return nullptr.

◆ createAndroidMicrophone()

std::unique_ptr<AndroidSLESMicrophone> alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine::createAndroidMicrophone ( std::shared_ptr< avsCommon::avs::AudioInputStream stream)

Creates a microphone wrapper for an OpenSL ES audio recorder.

Parameters
streamThe new microphone will write the audio recorded to this stream.
Returns
A unique pointer to an AndroidSLESMicrophone object if succeeds; otherwise return nullptr.

◆ createAudioRecorder() [1/2]

std::unique_ptr<AndroidSLESObject> alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine::createAudioRecorder ( )

Creates an OpenSL ES audio recorder.

Returns
A unique pointer to a new OpenSL ES audio recorder.

◆ createAudioRecorder() [2/2]

void alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine::createAudioRecorder ( SLObjectItf &  recorderObject)

Creates an OpenSL ES audio recorder.

Parameters
[in]recorderObjectThe new OpenSL ES audio recorder.

◆ createOutputMix()

std::unique_ptr<AndroidSLESObject> alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine::createOutputMix ( ) const

Creates an OpenSL ES output mix.

Returns
A unique pointer to an AndroidSLESObject object if succeeds; otherwise return nullptr.

◆ createPlayer()

std::unique_ptr<AndroidSLESObject> alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESEngine::createPlayer ( SLDataSource &  source,
SLDataSink &  sink,
bool  requireEqualizer 
) const

Creates an OpenSL ES audio player. Although the parameters are read-only, we cannot use const because android's API expects non-constant parameters.

Parameters
[in]sourceThe audio data source specification (Read-Only).
[in]sinkThe audio data sink specification (Read-Only).
[in]requireEqualizerset to true if equalizer support is required.
Returns
A unique pointer to an AndroidSLESObject object if succeeds; otherwise return nullptr.

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