#include <KittAiKeyWordDetector.h>
|
| AbstractKeywordDetector (std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::KeyWordObserverInterface >> keyWordObservers=std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::KeyWordObserverInterface >>(), std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::KeyWordDetectorStateObserverInterface >> keyWordDetectorStateObservers=std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::KeyWordDetectorStateObserverInterface >>()) |
|
void | notifyKeyWordObservers (std::shared_ptr< avsCommon::avs::AudioInputStream > stream, std::string keyword, avsCommon::avs::AudioInputStream::Index beginIndex, avsCommon::avs::AudioInputStream::Index endIndex, std::shared_ptr< const std::vector< char >> KWDMetadata=nullptr) const |
|
void | notifyKeyWordDetectorStateObservers (avsCommon::sdkInterfaces::KeyWordDetectorStateObserverInterface::KeyWordDetectorState state) |
|
ssize_t | readFromStream (std::shared_ptr< avsCommon::avs::AudioInputStream::Reader > reader, std::shared_ptr< avsCommon::avs::AudioInputStream > stream, void *buf, size_t nWords, std::chrono::milliseconds timeout, bool *errorOccurred) |
|
static bool | isByteswappingRequired (avsCommon::utils::AudioFormat audioFormat) |
|
◆ ~KittAiKeyWordDetector()
alexaClientSDK::kwd::KittAiKeyWordDetector::~KittAiKeyWordDetector |
( |
| ) |
|
|
override |
◆ create()
Creates a KittAiKeyWordDetector
.
- Parameters
-
stream | The stream of audio data. This should be formatted in LPCM encoded with 16 bits per sample and have a sample rate of 16 kHz. Additionally, the data should be in little endian format. |
audioFormat | The format of the audio data located within the stream. |
keyWordObservers | The observers to notify of keyword detections. |
keyWordDetectorStateObservers | The observers to notify of state changes in the engine. |
resourceFilePath | The path to the resource file. |
kittAiConfigurations | A vector of KittAiConfiguration objects that will be used to initialize the engine and keywords. |
audioGain | This controls whether to increase (>1) or decrease (<1) input volume. |
applyFrontEnd | Whether to apply frontend audio processing. |
msToPushPerIteration | The amount of data in milliseconds to push to Kitt.ai at a time. Smaller sizes will lead to less delay but more CPU usage. Additionally, larger amounts of data fed into the engine per iteration might lead longer delays before receiving keyword detection events. This has been defaulted to 20 milliseconds as it is a good trade off between CPU usage and recognition delay. |
- Returns
- A new
KittAiKeyWordDetector
, or nullptr
if the operation failed.
- See also
- https://github.com/Kitt-AI/snowboy for more information regarding
audioGain
and applyFrontEnd
.
The documentation for this class was generated from the following files:
AlexaClientSDK 1.24.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0