snowboy_ros
Public Member Functions | Private Attributes | List of all members
snowboy_ros::HotwordDetector Class Reference

The HotwordDetector class wraps Snowboy detect so we can use C++ 11. More...

#include <hotword_detector.h>

Public Member Functions

bool configure (double sensitivity, double audio_gain)
 configure Configure the detector on runtime More...
 
 HotwordDetector ()
 
void initialize (const char *resource_filename, const char *model_filename)
 initialize Initializes the Snowbody More...
 
int runDetection (const int16_t *const data, const int array_length)
 runDetection Runs hotword detection of Snowboy, see Snowboy API for more docs More...
 
 ~HotwordDetector ()
 

Private Attributes

snowboy::SnowboyDetectdetector_
 detector_ Instance of Snowboy detect More...
 

Detailed Description

The HotwordDetector class wraps Snowboy detect so we can use C++ 11.

Definition at line 12 of file hotword_detector.h.

Constructor & Destructor Documentation

◆ HotwordDetector()

snowboy_ros::HotwordDetector::HotwordDetector ( )

Definition at line 10 of file hotword_detector.cpp.

◆ ~HotwordDetector()

snowboy_ros::HotwordDetector::~HotwordDetector ( )

Definition at line 45 of file hotword_detector.cpp.

Member Function Documentation

◆ configure()

bool snowboy_ros::HotwordDetector::configure ( double  sensitivity,
double  audio_gain 
)

configure Configure the detector on runtime

Parameters
sensitivityHotword sensitivity
audio_gainFixed gain to the input audio.
Returns
True if success, False otherwise

Definition at line 29 of file hotword_detector.cpp.

◆ initialize()

void snowboy_ros::HotwordDetector::initialize ( const char *  resource_filename,
const char *  model_filename 
)

initialize Initializes the Snowbody

Parameters
[in]resource_filenameFilename of resource file
[in]model_filenameA string of multiple hotword models

Definition at line 14 of file hotword_detector.cpp.

◆ runDetection()

int snowboy_ros::HotwordDetector::runDetection ( const int16_t *const  data,
const int  array_length 
)

runDetection Runs hotword detection of Snowboy, see Snowboy API for more docs

Parameters
dataSmall chunk of data to be detected
array_lengthLength of the data array.
Returns
-3 not initialized, -2 Silence, -1 Error, 0 No event, 1 Hotword triggered

Definition at line 53 of file hotword_detector.cpp.

Member Data Documentation

◆ detector_

snowboy::SnowboyDetect* snowboy_ros::HotwordDetector::detector_
private

detector_ Instance of Snowboy detect

Definition at line 48 of file hotword_detector.h.


The documentation for this class was generated from the following files: