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::AndroidSLESMicrophone Class Reference

#include <AndroidSLESMicrophone.h>

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

Public Member Functions

bool configureRecognizeMode ()
 
 ~AndroidSLESMicrophone ()
 
MicrophoneInterface methods
bool stopStreamingMicrophoneData () override
 
bool startStreamingMicrophoneData () override
 
bool isStreaming () override
 
- Public Member Functions inherited from alexaClientSDK::applicationUtilities::resources::audio::MicrophoneInterface
virtual ~MicrophoneInterface ()=default
 

Static Public Member Functions

static std::unique_ptr< AndroidSLESMicrophonecreate (std::shared_ptr< AndroidSLESEngine > engine, std::shared_ptr< avsCommon::avs::AudioInputStream > stream)
 
static SLDataSink createSinkConfiguration ()
 
static SLDataSource createSourceConfiguration ()
 

Detailed Description

Class that represents the OpenSL ES microphone.

This class is responsible for setting the OpenSL ES microphone recording state as well as to trigger the AndroidSLESBufferQueue methods that manage the OpenSL ES microphone buffers.

The method startStreamingMicrophoneData should be used to start recording, and it's counterpart is stopStreamingMicrophoneData, which stops the recording and clear any unprocessed data.

Constructor & Destructor Documentation

◆ ~AndroidSLESMicrophone()

alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESMicrophone::~AndroidSLESMicrophone ( )

Destructor.

Member Function Documentation

◆ configureRecognizeMode()

bool alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESMicrophone::configureRecognizeMode ( )

Configure audio recorder to recognize mode.

Returns
true if it suceeds, and false if it fails.

◆ create()

static std::unique_ptr<AndroidSLESMicrophone> alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESMicrophone::create ( std::shared_ptr< AndroidSLESEngine engine,
std::shared_ptr< avsCommon::avs::AudioInputStream stream 
)
static

Creates an instance of an AndroidSLESMicrophone.

Parameters
engineEngine used to create the microphone, which should not be destroyed before the mic.
streamThe audio stream.
Returns
A unique pointer to an AndroidSLESMicrophone.

◆ createSinkConfiguration()

static SLDataSink alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESMicrophone::createSinkConfiguration ( )
static

Create audio sink configuration following AVS Speech Recognition parameters.

  • 16bit Linear PCM
  • 16kHz sample rate
  • Single channel
  • Little endian byte order
Returns
Struct with the audio sink configuration.

◆ createSourceConfiguration()

static SLDataSource alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESMicrophone::createSourceConfiguration ( )
static

Create audio source configuration.

Returns
Struct with the audio sink configuration.

◆ isStreaming()

bool alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESMicrophone::isStreaming ( )
overridevirtual

Whether the microphone is currently streaming.

Returns
Whether the microphone is streaming.

Implements alexaClientSDK::applicationUtilities::resources::audio::MicrophoneInterface.

◆ startStreamingMicrophoneData()

bool alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESMicrophone::startStreamingMicrophoneData ( )
overridevirtual

Starts streaming from the microphone.

Returns
Whether the start was successful.

Implements alexaClientSDK::applicationUtilities::resources::audio::MicrophoneInterface.

◆ stopStreamingMicrophoneData()

bool alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESMicrophone::stopStreamingMicrophoneData ( )
overridevirtual

Stops streaming from the microphone.

Returns
Whether the stop was successful.

Implements alexaClientSDK::applicationUtilities::resources::audio::MicrophoneInterface.


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