![]() |
AlexaClientSDK
1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <EncoderContext.h>
Public Member Functions | |
virtual bool | init (alexaClientSDK::avsCommon::utils::AudioFormat inputFormat)=0 |
virtual size_t | getInputFrameSize ()=0 |
virtual size_t | getOutputFrameSize ()=0 |
virtual bool | requiresFullyRead ()=0 |
virtual alexaClientSDK::avsCommon::utils::AudioFormat | getAudioFormat ()=0 |
virtual std::string | getAVSFormatName ()=0 |
virtual bool | start ()=0 |
virtual ssize_t | processSamples (void *samples, size_t numberOfWords, uint8_t *buffer)=0 |
virtual void | close ()=0 |
virtual | ~EncoderContext ()=default |
Interface class between SpeechEncoder
and the backend codec library. This class must be implemented by customer for each encoder codecs.
|
virtualdefault |
Destructor.
|
pure virtual |
Notify end of the session. Any backend library then may be deinitialized so it cleans memory and threads.
Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
|
pure virtual |
The AudioFormat
describes the encoded audio stream.
AudioFormat
describes the encoded audio stream. Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
|
pure virtual |
The string interpretation of the output format, that AVS cloud service can recognize.
Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
|
pure virtual |
The maximum number of sample can be processed at the same time. In other words, this will limits input PCM stream buffering. Thus nWords of processSamples call will never exceeds this limit.
Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
|
pure virtual |
The maximum length of the single encoded frame.
Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
|
pure virtual |
Pre-initialization before actual encoding session has began. Note that this function will be called everytime before new encoding session is starting.
inputFormat | The AudioFormat describes the audio format of the future incoming PCM frames. |
Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
|
pure virtual |
Encode next PCM samples. This function will be called continuously throughout the session.
samples | PCM samples to be encoded. The word size should be known via AudioFormat that has provided at pre-init function. |
numberOfWords | The number of samples (in words). |
buffer | The buffer where the encoded frames should be written. |
Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
|
pure virtual |
Determine whether PCM stream should be fully buffered with the maximum number of samples provided at getInputFrameSize function. This value will change the behavior of how processSamples is called during the encoding session. This is useful when backend encoder requires fixed length of input samples.
In case the encoding session has been shutdown before the buffere is filled fully, this will cause any partial data to be discarded. (e.g. stopEncoding has been called, or reaches the end of the data stream.)
Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
|
pure virtual |
When an encoding session has began, this function start will be called. The backend library then may be initialized for begin encoding.
Implemented in alexaClientSDK::speechencoder::OpusEncoderContext.
AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0