AlexaClientSDK
1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <SpeechEncoder.h>
Public Member Functions | |
SpeechEncoder (const std::shared_ptr< EncoderContext > &encoder) | |
~SpeechEncoder () | |
bool | startEncoding (const std::shared_ptr< alexaClientSDK::avsCommon::avs::AudioInputStream > &inputStream, alexaClientSDK::avsCommon::utils::AudioFormat inputFormat, avsCommon::avs::AudioInputStream::Index begin, avsCommon::avs::AudioInputStream::Reader::Reference reference) |
void | stopEncoding (bool stopImmediately=false) |
std::shared_ptr< alexaClientSDK::avsCommon::avs::AudioInputStream > | getEncodedStream () |
std::shared_ptr< EncoderContext > | getContext () |
Static Public Member Functions | |
static std::shared_ptr< SpeechEncoder > | createSpeechEncoder (const std::shared_ptr< EncoderContext > &encoder) |
This class provides generic interface between backend encoder implementation and the application who wants to encode audio stream within AudioInputStream
alexaClientSDK::speechencoder::SpeechEncoder::SpeechEncoder | ( | const std::shared_ptr< EncoderContext > & | encoder | ) |
Constructor.
encoder | The backend encoder implmentation. |
alexaClientSDK::speechencoder::SpeechEncoder::~SpeechEncoder | ( | ) |
Destructor.
|
static |
Factory method.
encoder | The backend encoder implmentation. |
std::shared_ptr< EncoderContext > alexaClientSDK::speechencoder::SpeechEncoder::getContext | ( | ) |
Retrieve a EncoderContext
that was given with initialization.
EncoderContext
std::shared_ptr< AudioInputStream > alexaClientSDK::speechencoder::SpeechEncoder::getEncodedStream | ( | ) |
Retrieve AudioInputStream
for encoding results.
AudioInputStream
for streaming encoding results for further processing. bool alexaClientSDK::speechencoder::SpeechEncoder::startEncoding | ( | const std::shared_ptr< alexaClientSDK::avsCommon::avs::AudioInputStream > & | inputStream, |
alexaClientSDK::avsCommon::utils::AudioFormat | inputFormat, | ||
avsCommon::avs::AudioInputStream::Index | begin, | ||
avsCommon::avs::AudioInputStream::Reader::Reference | reference | ||
) |
Start the new encoding session. SpeechEncoder
can manage only single session at the same time, thus this call will be failed when ongoing encoding session exists, or pre-initialization on EncoderContext
is failed.
inputStream | The AudioInputStream to stream audio from. (i.e. input stream that has raw PCM frames.) |
inputFormat | The AudioFormat to describe the audio format of the input stream. |
begin | The index where encoding should begin. |
reference | The reference for the index. |
void alexaClientSDK::speechencoder::SpeechEncoder::stopEncoding | ( | bool | stopImmediately = false | ) |
Stop current encoding session.
stopImmediately | Flag indicating that encoding should stop immediatly. If this flag is set to false (the default), encoding will continue until any existing data in the buffer has been encoded. If this flag is set to true , existing data in the buffer which has not already been encoded will be discarded, and encoding will stop immediately. |
AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0