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

Classes

class  MockEncoderContext
 
class  SpeechEncoderTest
 

Functions

 TEST_F (SpeechEncoderTest, testTimer_startEncoding)
 
 TEST_F (SpeechEncoderTest, test_shutdownOnBlockingWrite)
 
 TEST_F (SpeechEncoderTest, test_stopAndStartEncoder)
 

Variables

static constexpr size_t FRAME_WORDSIZE = 2
 Word size per PCM frame = 2byte (16bit) More...
 
static constexpr int NUM_AUDIO_WRITE = 100
 Number of dummy frames that will be sent to encoder. More...
 
static constexpr size_t MOCK_ENCODER_INPUT_FRAME_SIZE = 4
 Input frame size for mock encoder. Will accept 2 frames. (2 * 2byte = 4) More...
 
static constexpr size_t MOCK_ENCODER_OUTPUT_FRAME_SIZE = 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...
 

Function Documentation

◆ TEST_F() [1/3]

alexaClientSDK::speechencoder::test::TEST_F ( SpeechEncoderTest  ,
test_shutdownOnBlockingWrite   
)

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

◆ TEST_F() [2/3]

alexaClientSDK::speechencoder::test::TEST_F ( SpeechEncoderTest  ,
test_stopAndStartEncoder   
)

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

◆ TEST_F() [3/3]

alexaClientSDK::speechencoder::test::TEST_F ( SpeechEncoderTest  ,
testTimer_startEncoding   
)

Variable Documentation

◆ FRAME_WORDSIZE

constexpr size_t alexaClientSDK::speechencoder::test::FRAME_WORDSIZE = 2
staticconstexpr

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

◆ INPUT_WORD_COUNT

constexpr size_t alexaClientSDK::speechencoder::test::INPUT_WORD_COUNT = 4096
staticconstexpr

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::speechencoder::test::MAX_COMPRESSION_FACTOR = 10
staticconstexpr

The maximum factor of compression we expect to encounter.

◆ MOCK_ENCODER_FORMAT

const AudioFormat alexaClientSDK::speechencoder::test::MOCK_ENCODER_FORMAT
static
Initial value:
= {
AudioFormat::Encoding::LPCM,
AudioFormat::Endianness::LITTLE,
16000,
FRAME_WORDSIZE* CHAR_BIT,
1,
false,
AudioFormat::Layout::INTERLEAVED,
}

Output format for mock encoder.

◆ MOCK_ENCODER_INPUT_FRAME_SIZE

constexpr size_t alexaClientSDK::speechencoder::test::MOCK_ENCODER_INPUT_FRAME_SIZE = 4
staticconstexpr

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

◆ MOCK_ENCODER_OUTPUT_FRAME_SIZE

constexpr size_t alexaClientSDK::speechencoder::test::MOCK_ENCODER_OUTPUT_FRAME_SIZE = 4
staticconstexpr

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

◆ NUM_AUDIO_WRITE

constexpr int alexaClientSDK::speechencoder::test::NUM_AUDIO_WRITE = 100
staticconstexpr

Number of dummy frames that will be sent to encoder.

◆ PROCESSING_TIMEOUT

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

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

alexaClientSDK::speechencoder::test::FRAME_WORDSIZE
static constexpr size_t FRAME_WORDSIZE
Word size per PCM frame = 2byte (16bit)
Definition: SpeechEncoderTest.cpp:38

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