12 class PipelinePersonalEnroll;
13 class PipelineTemplateCut;
23 friend class testing::Inspector;
49 const std::string& model_str);
96 int RunDetection(
const std::string& data,
bool is_end =
false);
114 const int array_length,
bool is_end =
false);
132 const int array_length,
bool is_end =
false);
150 const int array_length,
bool is_end =
false);
254 std::unique_ptr<WaveHeader> wave_header_;
255 std::unique_ptr<PipelineDetect> detect_pipeline_;
267 friend class testing::Inspector;
277 SnowboyVad(
const std::string& resource_filename);
311 int RunVad(
const std::string& data,
bool is_end =
false);
328 int RunVad(
const float*
const data,
329 const int array_length,
bool is_end =
false);
346 int RunVad(
const int16_t*
const data,
347 const int array_length,
bool is_end =
false);
364 int RunVad(
const int32_t*
const data,
365 const int array_length,
bool is_end =
false);
415 std::unique_ptr<WaveHeader> wave_header_;
416 std::unique_ptr<PipelineVad> vad_pipeline_;
425 friend class testing::Inspector;
474 int RunEnrollment(
const float*
const data,
const int array_length);
490 int RunEnrollment(
const int16_t*
const data,
const int array_length);
506 int RunEnrollment(
const int32_t*
const data,
const int array_length);
551 std::unique_ptr<WaveHeader> wave_header_;
552 std::unique_ptr<PipelinePersonalEnroll> enroll_pipeline_;
562 friend class testing::Inspector;
604 int CutTemplate(
const float*
const data,
const int array_length,
float*
const data_out,
int* array_length_out);
623 int CutTemplate(
const int16_t*
const data,
const int array_length, int16_t*
const data_out,
int* array_length_out);
642 int CutTemplate(
const int32_t*
const data,
const int array_length, int32_t*
const data_out,
int* array_length_out);
676 std::unique_ptr<WaveHeader> wave_header_;
677 std::unique_ptr<PipelineTemplateCut> cut_pipeline_;
Hotword detector class.
Definition: snowboy-detect.h:22
SnowboyDetect(const std::string &resource_filename, const std::string &model_str)
Default constructor.
Definition: snowboy-detect.cpp:13
std::string GetSensitivity() const
Returns the sensitivity string for the current hotwords.
Definition: snowboy-detect.cpp:101
void SetSensitivity(const std::string &sensitivity_str)
Sets the sensitivity string for the loaded hotwords.
Definition: snowboy-detect.cpp:93
void UpdateModel() const
Writes the models to the model filenames specified in <model_str> in the constructor.
Definition: snowboy-detect.cpp:109
int NumHotwords() const
Returns the number of the loaded hotwords.
Definition: snowboy-detect.cpp:113
void SetHighSensitivity(const std::string &high_sensitivity_str)
Sets the high sensitivity string for the loaded hotwords.
Definition: snowboy-detect.cpp:97
int BitsPerSample() const
Returns the expected number of bits for audio provided to RunDetection().
Definition: snowboy-detect.cpp:129
int SampleRate() const
Returns the expected sample rate for audio provided to RunDetection().
Definition: snowboy-detect.cpp:121
~SnowboyDetect()
Destructor.
Definition: snowboy-detect.cpp:27
void SetAudioGain(const float audio_gain)
Apply a fixed gain to the input audio.
Definition: snowboy-detect.cpp:105
int NumChannels() const
Returns the expected number of channels for audio provided to RunDetection().
Definition: snowboy-detect.cpp:125
bool Reset()
Resets the detection.
Definition: snowboy-detect.cpp:32
int RunDetection(const std::string &data, bool is_end=false)
Runs hotword detection.
Definition: snowboy-detect.cpp:37
void ApplyFrontend(const bool apply_frontend)
Enable or disable audio frontend (NS & AGC).
Definition: snowboy-detect.cpp:117
Enrollment class.
Definition: snowboy-detect.h:424
int NumChannels() const
Returns the expected number of channels for audio provided to RunDetection().
Definition: snowboy-detect.cpp:322
int SampleRate() const
Returns the expected sample rate for audio provided to RunDetection().
Definition: snowboy-detect.cpp:318
int RunEnrollment(const std::string &data)
Runs the hotword enrollment.
Definition: snowboy-detect.cpp:244
int GetNumTemplates() const
Returns the minimum number of recordings required for the new hotword.
Definition: snowboy-detect.cpp:314
int BitsPerSample() const
Returns the expected number of bits for audio provided to RunDetection().
Definition: snowboy-detect.cpp:326
SnowboyPersonalEnroll(const std::string &resource_filename, const std::string &model_filename)
Default constructor.
Definition: snowboy-detect.cpp:232
~SnowboyPersonalEnroll()
Destructor.
Definition: snowboy-detect.cpp:330
bool Reset()
Resets the enrollment.
Definition: snowboy-detect.cpp:309
Template cut class.
Definition: snowboy-detect.h:561
int BitsPerSample() const
Returns the expected number of bits for audio provided to RunDetection().
Definition: snowboy-detect.cpp:427
std::string CutTemplate(const std::string &data)
Cuts the provided sample.
Definition: snowboy-detect.cpp:345
int NumChannels() const
Returns the expected number of channels for audio provided to RunDetection().
Definition: snowboy-detect.cpp:423
SnowboyTemplateCut(const std::string &resource_filename)
Default constructor.
Definition: snowboy-detect.cpp:332
~SnowboyTemplateCut()
Destructor.
Definition: snowboy-detect.cpp:431
bool Reset()
Resets the enrollment.
Definition: snowboy-detect.cpp:414
int SampleRate() const
Returns the expected sample rate for audio provided to RunDetection().
Definition: snowboy-detect.cpp:419
Voice activity detector class.
Definition: snowboy-detect.h:266
int RunVad(const std::string &data, bool is_end=false)
Runs the VAD algorithm.
Definition: snowboy-detect.cpp:156
bool Reset()
Resets the vad.
Definition: snowboy-detect.cpp:151
int SampleRate() const
Returns the expected sample rate for audio provided to RunDetection().
Definition: snowboy-detect.cpp:220
int BitsPerSample() const
Returns the expected number of bits for audio provided to RunDetection().
Definition: snowboy-detect.cpp:228
void ApplyFrontend(const bool apply_frontend)
Enable or disable audio frontend (NS & AGC).
Definition: snowboy-detect.cpp:216
~SnowboyVad()
Destructor.
Definition: snowboy-detect.cpp:146
int NumChannels() const
Returns the expected number of channels for audio provided to RunDetection().
Definition: snowboy-detect.cpp:224
void SetAudioGain(const float audio_gain)
Apply a fixed gain to the input audio.
Definition: snowboy-detect.cpp:212
SnowboyVad(const std::string &resource_filename)
Default constructor.
Definition: snowboy-detect.cpp:133
Definition: matrix-wrapper.h:11