![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Interface for encoding audio stream. More...
#include <AudioEncoderInterface.h>
Public Member Functions | |
virtual | ~AudioEncoderInterface ()=default |
Virtual destructor. More... | |
virtual std::shared_ptr< avsCommon::avs::AudioInputStream > | startEncoding (const std::shared_ptr< avsCommon::avs::AudioInputStream > &inputStream, avsCommon::utils::AudioFormat inputFormat, avsCommon::avs::AudioInputStream::Index begin, avsCommon::avs::AudioInputStream::Reader::Reference reference)=0 |
Start the new encoding session. More... | |
virtual void | stopEncoding (bool stopImmediately=false)=0 |
Stop current encoding session. More... | |
virtual avsCommon::utils::AudioFormat::Encoding | getEncoding ()=0 |
Get output encoding type. More... | |
virtual std::string | getAVSFormatName ()=0 |
Get output format name for AVS service. More... | |
Interface for encoding audio stream.
This class provides generic interface between audio stream encoder implementation and the application who wants to encode audio stream.
Encoder converts input audio stream into encoded format. Each encoder implementation is expected to support one output format which doesn't change over time.
Encoding operation starts with startEncoding() call and finished in one of the following cases:
Encoder supports a single encoding session, but there can be more than one encoder in the system.
|
virtualdefault |
Virtual destructor.
|
pure virtual |
Get output format name for AVS service.
This method returns output format name for AVS service. The encoder may change the format depending on configuration when encoding starts with startEncoding() call, and the clients should use this method after it. The AVS format name doesn't change until the next call to startEncoding().
|
pure virtual |
Get output encoding type.
Method returns output encoding type.
|
pure virtual |
Start the new encoding session.
Method starts the new encoding session. Object can manage only single session at the same time, thus this call will fail if ongoing encoding session exists.
If the method succeeds, client may request to stop encoding with stopEncoding() call. The encoding session will continue until stopped, end of inputStream is reached, or encoder encounters an error.
When this method is called, encoder may change the format returned with getAVSFormatName() method based on input format.
[in] | inputStream | The AudioStream to stream audio from. (i.e.input stream that has raw PCM frames.) |
[in] | inputFormat | The AudioFormat to describe the audio format of the input stream. |
[in] | begin | The index where encoding should begin. |
[in] | reference | The reference for the index. |
|
pure virtual |
Stop current encoding session.
Method stops current encoding session if it exists. If there is an ongoing encoding session, the method returns after the session is terminated.
This method has an execution timeout, and even if stopImmediately is false, encoding will be aborted if it cannot be stopped gracefully.
[in] | stopImmediately | Flag indicating that encoding should stop immediately. 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 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0