AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Typedefs | Functions | Variables
alexaClientSDK::audioEncoder::test Namespace Reference

Classes

class  AudioEncoderTest
 
class  MockEncoderContext
 

Typedefs

using Bytes = BlockAudioEncoderInterface::Bytes
 

Functions

 TEST_F (AudioEncoderTest, testTimer_startEncoding)
 
 TEST_F (AudioEncoderTest, test_shutdownOnBlockingWrite)
 
 TEST_F (AudioEncoderTest, test_stopAndStartEncoder)
 

Variables

static constexpr size_t FRAME_WORDSIZE = 2
 Word size per PCM frame = 2byte (16bit) More...
 
static constexpr size_t NUM_AUDIO_WRITE = 100
 Number of dummy frames that will be sent to encoder. More...
 
static constexpr size_t MOCK_ENCODER_INPUT_FRAME_SIZE_WORDS = 2
 Input frame size for mock encoder. Will accept 2 frames. (2 * 2byte = 4) More...
 
static constexpr size_t MOCK_ENCODER_OUTPUT_FRAME_SIZE_BYTES = 4
 Output frame size for mock encoder. Will output 2 frames per encode. (2 * 2byte = 4) More...
 
static constexpr size_t INPUT_WORD_COUNT = 4096
 Number of words in input stream SDS buffer (must be large enough to fill encoder's output stream) More...
 
static auto PROCESSING_TIMEOUT = std::chrono::milliseconds(200)
 Short timeout (needs to be greater than SpeechEncoder's BLOCKING writer timeout). More...
 
static constexpr unsigned int MAX_COMPRESSION_FACTOR = 10
 The maximum factor of compression we expect to encounter. More...
 
static const AudioFormat MOCK_ENCODER_FORMAT
 Output format for mock encoder. More...
 

Typedef Documentation

◆ Bytes

Function Documentation

◆ TEST_F() [1/3]

alexaClientSDK::audioEncoder::test::TEST_F ( AudioEncoderTest  ,
testTimer_startEncoding   
)

◆ TEST_F() [2/3]

alexaClientSDK::audioEncoder::test::TEST_F ( AudioEncoderTest  ,
test_shutdownOnBlockingWrite   
)

Test if encoding thread will exit if encoder output is not being consumed on exit.

◆ TEST_F() [3/3]

alexaClientSDK::audioEncoder::test::TEST_F ( AudioEncoderTest  ,
test_stopAndStartEncoder   
)

Test if encoding thread will exit and create again when stopEncoding() and startEncoding() is called in quick succession.

Variable Documentation

◆ FRAME_WORDSIZE

constexpr size_t alexaClientSDK::audioEncoder::test::FRAME_WORDSIZE = 2
static

Word size per PCM frame = 2byte (16bit)

◆ INPUT_WORD_COUNT

constexpr size_t alexaClientSDK::audioEncoder::test::INPUT_WORD_COUNT = 4096
static

Number of words in input stream SDS buffer (must be large enough to fill encoder's output stream)

◆ MAX_COMPRESSION_FACTOR

constexpr unsigned int alexaClientSDK::audioEncoder::test::MAX_COMPRESSION_FACTOR = 10
static

The maximum factor of compression we expect to encounter.

◆ MOCK_ENCODER_FORMAT

const AudioFormat alexaClientSDK::audioEncoder::test::MOCK_ENCODER_FORMAT
static
Initial value:
= {
AudioFormat::Encoding::LPCM,
AudioFormat::Endianness::LITTLE,
16000,
FRAME_WORDSIZE* CHAR_BIT,
1,
false,
AudioFormat::Layout::INTERLEAVED,
}
static constexpr size_t FRAME_WORDSIZE
Word size per PCM frame = 2byte (16bit)
Definition: AudioEncoderTest.cpp:43

Output format for mock encoder.

◆ MOCK_ENCODER_INPUT_FRAME_SIZE_WORDS

constexpr size_t alexaClientSDK::audioEncoder::test::MOCK_ENCODER_INPUT_FRAME_SIZE_WORDS = 2
static

Input frame size for mock encoder. Will accept 2 frames. (2 * 2byte = 4)

◆ MOCK_ENCODER_OUTPUT_FRAME_SIZE_BYTES

constexpr size_t alexaClientSDK::audioEncoder::test::MOCK_ENCODER_OUTPUT_FRAME_SIZE_BYTES = 4
static

Output frame size for mock encoder. Will output 2 frames per encode. (2 * 2byte = 4)

◆ NUM_AUDIO_WRITE

constexpr size_t alexaClientSDK::audioEncoder::test::NUM_AUDIO_WRITE = 100
static

Number of dummy frames that will be sent to encoder.

◆ PROCESSING_TIMEOUT

auto alexaClientSDK::audioEncoder::test::PROCESSING_TIMEOUT = std::chrono::milliseconds(200)
static

Short timeout (needs to be greater than SpeechEncoder's BLOCKING writer timeout).

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0