AlexaClientSDK  1.24.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::kwd::SnowboyWrapper Class Reference

#include <SnowboyWrapper.h>

Public Member Functions

 SnowboyWrapper (const char *resourceFilename, const char *model)
 
 ~SnowboyWrapper ()=default
 
int RunDetection (const int16_t *const data, const int arrayLength, bool isEnd=false)
 
void SetSensitivity (const char *sensitivity)
 
void SetAudioGain (const float audioGain)
 
void ApplyFrontend (const bool applyFrontend)
 
int SampleRate () const
 
int NumChannels () const
 
int BitsPerSample () const
 

Detailed Description

The wrapper class for snowboy::SnowboyDetect class.

Since the original API exposes std::string which will be ABI incompatible with GCC 5.1, this class replace them with const char*.

We keep the actual instantiation in void* pointer in this header, to prevent from other files to include snowboy-detect.h file.

Thanks to the community for the original idea: https://github.com/Kitt-AI/snowboy/issues/99

Constructor & Destructor Documentation

◆ SnowboyWrapper()

alexaClientSDK::kwd::SnowboyWrapper::SnowboyWrapper ( const char *  resourceFilename,
const char *  model 
)

Call snowboy::SnowboyDetect::SnowboyDetect constructor

Parameters
resourceFilenamefor the first argument of the original API call.
modelfor the second argument of the original API call.

◆ ~SnowboyWrapper()

alexaClientSDK::kwd::SnowboyWrapper::~SnowboyWrapper ( )
default

Destructor

Member Function Documentation

◆ ApplyFrontend()

void alexaClientSDK::kwd::SnowboyWrapper::ApplyFrontend ( const bool  applyFrontend)

Call snowboy::SnowboyDetect::ApplyFrontend

Parameters
applyFrontendfor the first argument of the original API call.

◆ BitsPerSample()

int alexaClientSDK::kwd::SnowboyWrapper::BitsPerSample ( ) const

Call snowboy::SnowboyDetect::BitsPerSample

Returns
the value of the original API call result.

◆ NumChannels()

int alexaClientSDK::kwd::SnowboyWrapper::NumChannels ( ) const

Call snowboy::SnowboyDetect::NumChannels

Returns
the value of the original API call result.

◆ RunDetection()

int alexaClientSDK::kwd::SnowboyWrapper::RunDetection ( const int16_t *const  data,
const int  arrayLength,
bool  isEnd = false 
)

Call snowboy::SnowboyDetect::RunDetection

Parameters
datafor the first argument of the original API call.
arrayLengthfor the second argument of the original API call.
isEndfor the third argument of the original API call.
Returns
the value of the original API call result.

◆ SampleRate()

int alexaClientSDK::kwd::SnowboyWrapper::SampleRate ( ) const

Call snowboy::SnowboyDetect::SampleRate

Returns
the value of the original API call result.

◆ SetAudioGain()

void alexaClientSDK::kwd::SnowboyWrapper::SetAudioGain ( const float  audioGain)

Call snowboy::SnowboyDetect::SetAudioGain

Parameters
audioGainfor the first argument of the original API call.

◆ SetSensitivity()

void alexaClientSDK::kwd::SnowboyWrapper::SetSensitivity ( const char *  sensitivity)

Call snowboy::SnowboyDetect::SetSensitivity

Parameters
sensitivityfor the first argument of the original API call.

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