![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <AndroidSLESBufferQueue.h>
Public Member Functions | |
void | onBufferCompleted () |
bool | enqueueBuffers () |
bool | clearBuffers () |
~AndroidSLESBufferQueue () | |
Static Public Member Functions | |
static std::unique_ptr< AndroidSLESBufferQueue > | create (std::shared_ptr< AndroidSLESObject > queueObject, std::shared_ptr< avsCommon::avs::AudioInputStream::Writer > writer) |
Static Public Attributes | |
static constexpr uint32_t | NUMBER_OF_BUFFERS {2u} |
The number of buffers to use. More... | |
Class responsible for consuming data produced from an AndroidSLESObject.
For that, it keeps a circular buffer queue that it feeds to the OpenSL ES microphone. When the microphone is recording it should call enqueueBuffers
to enqueue all free buffers to the OpenSL ES object.
Whenever the OpenSL ES microphone fills up a buffer, it calls the onBufferCompleted
method, which will copy the recorded data to the AudioInputStream
and enqueue the same buffer back.
When recording is stopped, clearBuffers can be used to clear all buffers with any previously recorded data.
alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESBufferQueue::~AndroidSLESBufferQueue | ( | ) |
Destructor.
bool alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESBufferQueue::clearBuffers | ( | ) |
Clear all the buffers from the queue.
true
if succeeds and false
otherwise.
|
static |
Creates a new AndroidSLESBufferQueue
object.
queueObject | The AndroidSLESObject that represent the OpenSL ES microphone and queue. |
writer | The buffer writer to copy the recorded audio to. |
nullptr
. bool alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESBufferQueue::enqueueBuffers | ( | ) |
Add all free buffers into the queue.
true
if succeeds and false
otherwise. void alexaClientSDK::applicationUtilities::androidUtilities::AndroidSLESBufferQueue::onBufferCompleted | ( | ) |
The callback function to be called when a buffer has been filled with recorded data. This function will copy the data out of the filled buffer into its AudioInputStream
.
|
static |
The number of buffers to use.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0