#include <SensoryKeywordDetector.h>
|
static std::unique_ptr< SensoryKeywordDetector > | create (const std::shared_ptr< AudioInputStream > stream, const std::shared_ptr< avsCommon::utils::AudioFormat > &audioFormat, std::shared_ptr< acsdkKWDInterfaces::KeywordNotifierInterface > keyWordNotifier, std::shared_ptr< acsdkKWDInterfaces::KeywordDetectorStateNotifierInterface > KeyWordDetectorStateNotifier, const std::string &modelFilePath, std::chrono::milliseconds msToPushPerIteration=std::chrono::milliseconds(10)) |
|
static std::unique_ptr< SensoryKeywordDetector > | create (const std::shared_ptr< AudioInputStream > stream, avsCommon::utils::AudioFormat audioFormat, std::unordered_set< std::shared_ptr< KeyWordObserverInterface >> keyWordObservers, std::unordered_set< std::shared_ptr< KeyWordDetectorStateObserverInterface >> keyWordDetectorStateObservers, const std::string &modelFilePath, std::chrono::milliseconds msToPushPerIteration=std::chrono::milliseconds(10)) |
|
|
| 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 >>()) |
|
| AbstractKeywordDetector (std::shared_ptr< acsdkKWDInterfaces::KeywordNotifierInterface > keywordNotifier, std::shared_ptr< acsdkKWDInterfaces::KeywordDetectorStateNotifierInterface > keyWordDetectorStateNotifier) |
|
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) |
|
◆ ~SensoryKeywordDetector()
alexaClientSDK::kwd::SensoryKeywordDetector::~SensoryKeywordDetector |
( |
| ) |
|
|
override |
◆ create() [1/2]
- Deprecated:
- Creates a
SensoryKeywordDetector
. Requires that the AlexaClientSDKConfig.json has a modelFilePath value under sampleApp
- 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. |
modelFilePath | The path to the model file. |
msToPushPerIteration | The amount of data in milliseconds to push to Sensory 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 10 milliseconds as it is a good trade off between CPU usage and recognition delay. Additionally, this was the amount used by Sensory in example code. |
- Returns
- A new
SensoryKeywordDetector
, or nullptr
if the operation failed.
◆ create() [2/2]
Creates a SensoryKeywordDetector
. Requires that the AlexaClientSDKConfig.json has a modelFilePath value under sampleApp
- 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. |
keyWordNotifier | The object with which to notifiy observers of keyword detections. |
KeyWordDetectorStateNotifier | The object with which to notify observers of state changes in the engine. |
modelFilePath | The path to the model file. |
msToPushPerIteration | The amount of data in milliseconds to push to Sensory 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 10 milliseconds as it is a good trade off between CPU usage and recognition delay. Additionally, this was the amount used by Sensory in example code. |
- Returns
- A new
SensoryKeywordDetector
, or nullptr
if the operation failed.
The documentation for this class was generated from the following files:
AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0