AlexaClientSDK  1.20.1
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Macros | Functions | Variables
AudioInputProcessor.cpp File Reference
#include <algorithm>
#include <cctype>
#include <list>
#include <sstream>
#include <AVSCommon/AVS/CapabilityConfiguration.h>
#include <AVSCommon/AVS/FocusState.h>
#include <AVSCommon/AVS/MessageRequest.h>
#include <AVSCommon/Utils/JSON/JSONGenerator.h>
#include <AVSCommon/Utils/JSON/JSONUtils.h>
#include <AVSCommon/Utils/Logger/Logger.h>
#include <AVSCommon/Utils/Memory/Memory.h>
#include <AVSCommon/Utils/Metrics.h>
#include <AVSCommon/Utils/Metrics/DataPointDurationBuilder.h>
#include <AVSCommon/Utils/Metrics/DataPointCounterBuilder.h>
#include <AVSCommon/Utils/Metrics/DataPointStringBuilder.h>
#include <AVSCommon/Utils/Metrics/MetricEventBuilder.h>
#include <AVSCommon/Utils/String/StringUtils.h>
#include <AVSCommon/Utils/UUIDGeneration/UUIDGeneration.h>
#include <AVSCommon/AVS/Attachment/AttachmentUtils.h>
#include <Settings/SettingEventMetadata.h>
#include <Settings/SettingEventSender.h>
#include <Settings/SharedAVSSettingProtocol.h>
#include <SpeechEncoder/SpeechEncoder.h>
#include <AVSCommon/AVS/Attachment/DefaultAttachmentReader.h>
#include "AIP/AudioInputProcessor.h"
Include dependency graph for AudioInputProcessor.cpp:

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::capabilityAgents
 
 alexaClientSDK::capabilityAgents::aip
 

Macros

#define LX(event)   alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
 

Functions

static const std::string alexaClientSDK::capabilityAgents::aip::TAG ("AudioInputProcessor")
 String to identify log entries originating from this file. More...
 
static void alexaClientSDK::capabilityAgents::aip::submitMetric (const std::shared_ptr< MetricRecorderInterface > &metricRecorder, const std::string &activityName, const DataPoint &dataPoint, const std::string &dialogRequestId="")
 
static void alexaClientSDK::capabilityAgents::aip::submitMetric (const std::shared_ptr< MetricRecorderInterface > &metricRecorder, MetricEventBuilder &metricEventBuilder, const std::string &dialogRequestId="")
 
static void alexaClientSDK::capabilityAgents::aip::submitMetric (const std::shared_ptr< MetricRecorderInterface > metricRecorder, const std::string &activityName, const DataPoint &dataPoint, const std::shared_ptr< AVSDirective > &directive=nullptr)
 
static std::shared_ptr< avsCommon::avs::CapabilityConfiguration > alexaClientSDK::capabilityAgents::aip::getSpeechRecognizerCapabilityConfiguration (const LocaleAssetsManagerInterface &assetsManager)
 
std::string alexaClientSDK::capabilityAgents::aip::generateSupportedWakeWordsJson (const std::string &scope, const LocaleAssetsManagerInterface::WakeWordsSets &wakeWordsCombination)
 

Variables

static const std::string alexaClientSDK::capabilityAgents::aip::SPEECHRECOGNIZER_CAPABILITY_INTERFACE_TYPE = "AlexaInterface"
 
static const std::string alexaClientSDK::capabilityAgents::aip::SPEECHRECOGNIZER_CAPABILITY_INTERFACE_NAME = "SpeechRecognizer"
 SpeechRecognizer interface name. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::SPEECHRECOGNIZER_CAPABILITY_INTERFACE_VERSION = "2.3"
 SpeechRecognizer interface version. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::CAPABILITY_INTERFACE_CONFIGURATIONS_KEY = "configurations"
 Configuration key used to give more details about the device configuration. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::CAPABILITY_INTERFACE_WAKE_WORDS_KEY = "wakeWords"
 Supported wake words key. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::CAPABILITY_MAXIMUM_CONCURRENT_WAKEWORDS_KEY = "maximumConcurrentWakeWords"
 Supported maximum number of concurrent wakewords key. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::CAPABILITY_INTERFACE_SCOPES_KEY = "scopes"
 The scope key for each wake words set. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::CAPABILITY_INTERFACE_VALUES_KEY = "values"
 The wake word values for a given scope. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::CAPABILITY_INTERFACE_DEFAULT_LOCALE = "DEFAULT"
 The scope configuration used as default locale wake words support. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::CHANNEL_NAME = FocusManagerInterface::DIALOG_CHANNEL_NAME
 The name of the FocusManager channel used by AudioInputProvider. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::NAMESPACE = "SpeechRecognizer"
 The namespace for this capability agent. More...
 
static const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::STOP_CAPTURE {NAMESPACE, "StopCapture"}
 The StopCapture directive signature. More...
 
static const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::EXPECT_SPEECH {NAMESPACE, "ExpectSpeech"}
 The ExpectSpeech directive signature. More...
 
static const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::SET_END_OF_SPEECH_OFFSET {NAMESPACE, "SetEndOfSpeechOffset"}
 The SetEndOfSpeechOffset directive signature. More...
 
static const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::SET_WAKE_WORD_CONFIRMATION {NAMESPACE, "SetWakeWordConfirmation"}
 The SetWakeWordConfirmation directive signature. More...
 
static const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::SET_SPEECH_CONFIRMATION {NAMESPACE, "SetSpeechConfirmation"}
 The SetSpeechConfirmation directive signature. More...
 
static const avsCommon::avs::NamespaceAndName alexaClientSDK::capabilityAgents::aip::SET_WAKE_WORDS {NAMESPACE, "SetWakeWords"}
 The SetWakeWords directive signature. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::INITIATOR_KEY = "initiator"
 The field identifying the initiator. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::PROFILE_KEY = "profile"
 The field identifying the initiator's profile. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::FORMAT_KEY = "format"
 The field identifying the initiator's format. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::TYPE_KEY = "type"
 The field identifying the initiator's type. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::TOKEN_KEY = "token"
 The field identifying the initiator's token. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::PAYLOAD_KEY = "payload"
 The field identifying the initiator's payload. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WAKEWORD_INDICES_KEY = "wakeWordIndices"
 The field identifying the initiator's wakeword indices. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::START_INDEX_KEY = "startIndexInSamples"
 The field identifying the initiator's wakeword start index. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::END_INDEX_KEY = "endIndexInSamples"
 The field identifying the initiator's wakeword end index. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WAKE_WORD_KEY = "wakeWord"
 The field identifying the initiator's wake word. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::AUDIO_ATTACHMENT_FIELD_NAME = "audio"
 The field name for the user voice attachment. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::KWD_METADATA_FIELD_NAME = "wakewordEngineMetadata"
 The field name for the wake word engine metadata. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::START_OF_SPEECH_TIMESTAMP_FIELD_NAME = "startOfSpeechTimestamp"
 
static const std::string alexaClientSDK::capabilityAgents::aip::END_OF_SPEECH_OFFSET_FIELD_NAME = "endOfSpeechOffsetInMilliseconds"
 The field name for the end of speech offset, reported in milliseconds, as part of SetEndOfSpeechOffset payload. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WAKE_WORD_CONFIRMATION_CHANGED_EVENT_NAME = "WakeWordConfirmationChanged"
 The value of the WakeWordConfirmationChanged Event name. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WAKE_WORD_CONFIRMATION_REPORT_EVENT_NAME = "WakeWordConfirmationReport"
 The value of the WakeWordConfirmationReport Event name. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WAKE_WORD_CONFIRMATION_PAYLOAD_KEY = "wakeWordConfirmation"
 The value of the payload key for wakeWordConfirmation. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::SPEECH_CONFIRMATION_CHANGED_EVENT_NAME = "SpeechConfirmationChanged"
 The value of the SpeechConfirmationChanged Event name. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::SPEECH_CONFIRMATION_REPORT_EVENT_NAME = "SpeechConfirmationReport"
 The value of the SpeechConfirmationReport Event name. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::SPEECH_CONFIRMATION_PAYLOAD_KEY = "speechConfirmation"
 The value of the payload key for speechConfirmation. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WAKE_WORDS_CHANGED_EVENT_NAME = "WakeWordsChanged"
 The value of the WakeWordsChanged Event name. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WAKE_WORDS_REPORT_EVENT_NAME = "WakeWordsReport"
 The value of the WakeWordsReport Event name. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WAKE_WORDS_PAYLOAD_KEY = "wakeWords"
 The value of the payload key for wake words. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::POWER_RESOURCE_COMPONENT_NAME = "AudioInputProcessor"
 The component name of power management. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::METRIC_ACTIVITY_NAME_PREFIX_AIP = "AIP-"
 Metric Activity Name Prefix for AIP metric source. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::START_OF_UTTERANCE = "START_OF_UTTERANCE"
 Start of Utterance Activity Name for AIP metric source. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::START_OF_UTTERANCE_ACTIVITY_NAME = METRIC_ACTIVITY_NAME_PREFIX_AIP + START_OF_UTTERANCE
 
static const std::string alexaClientSDK::capabilityAgents::aip::START_OF_STREAM_TIMESTAMP = "START_OF_STREAM_TIMESTAMP"
 Wakeword Activity Name for AIP metric source. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::WW_DURATION = "WW_DURATION"
 
static const std::string alexaClientSDK::capabilityAgents::aip::WW_DURATION_ACTIVITY_NAME = METRIC_ACTIVITY_NAME_PREFIX_AIP + WW_DURATION
 
static const std::string alexaClientSDK::capabilityAgents::aip::STOP_CAPTURE_RECEIVED = "STOP_CAPTURE"
 Stop Capture Received Activity Name for AIP metric source. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::STOP_CAPTURE_RECEIVED_ACTIVITY_NAME = METRIC_ACTIVITY_NAME_PREFIX_AIP + STOP_CAPTURE_RECEIVED
 
static const std::string alexaClientSDK::capabilityAgents::aip::END_OF_SPEECH_OFFSET_RECEIVED = "END_OF_SPEECH_OFFSET"
 End of Speech Offset Received Activity Name for AIP metric source. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::END_OF_SPEECH_OFFSET_RECEIVED_ACTIVITY_NAME
 
static const std::string alexaClientSDK::capabilityAgents::aip::STOP_CAPTURE_TO_END_OF_SPEECH_METRIC_NAME = "STOP_CAPTURE_TO_END_OF_SPEECH"
 The duration metric for short time out. More...
 
static const std::string alexaClientSDK::capabilityAgents::aip::STOP_CAPTURE_TO_END_OF_SPEECH_ACTIVITY_NAME
 
static const std::chrono::milliseconds alexaClientSDK::capabilityAgents::aip::PREROLL_DURATION = std::chrono::milliseconds(500)
 Preroll duration is a fixed 500ms. More...
 
static const int alexaClientSDK::capabilityAgents::aip::MILLISECONDS_PER_SECOND = 1000
 

Macro Definition Documentation

◆ LX

#define LX (   event)    alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)

Create a LogEntry using this file's TAG and the specified event string.

Parameters
Theevent string for this LogEntry.

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