Snowman  0.1.0
snowboy-detect-c.h
1 #pragma once
2 #ifdef __cplusplus
3 extern "C"
4 {
5 #endif
6 
7  extern void SNOWMAN_free(void*);
8 
9  struct SNOWMAN_Detect;
10  struct SNOWMAN_Vad;
12  struct SNOWMAN_TemplateCut;
13 
14  SNOWMAN_Detect* SNOWMAN_Detect_Create(const char* resource_filename, const char* model_str);
15  int SNOWMAN_Detect_Reset(SNOWMAN_Detect* instance);
16  int SNOWMAN_Detect_RunDetectionWave(SNOWMAN_Detect* instance, const void* data, unsigned int len, int is_end);
17  int SNOWMAN_Detect_RunDetectionFloat(SNOWMAN_Detect* instance, const float* data, unsigned int num_samples, int is_end);
18  int SNOWMAN_Detect_RunDetectionShort(SNOWMAN_Detect* instance, const short* data, unsigned int num_samples, int is_end);
19  int SNOWMAN_Detect_RunDetectionInt(SNOWMAN_Detect* instance, const int* data, unsigned int num_samples, int is_end);
20  int SNOWMAN_Detect_SetSensitivity(SNOWMAN_Detect* instance, const char* sensitivity);
21  int SNOWMAN_Detect_SetHighSensitivity(SNOWMAN_Detect* instance, const char* sensitivity);
22  // Returned pointer needs to get freed using SNOWMAN_free
23  int SNOWMAN_Detect_GetSensitivity(SNOWMAN_Detect* instance, char** pointer);
24  int SNOWMAN_Detect_SetAudioGain(SNOWMAN_Detect* instance, float gain);
25  int SNOWMAN_Detect_UpdateModel(SNOWMAN_Detect* instance);
26  int SNOWMAN_Detect_NumHotwords(SNOWMAN_Detect* instance);
27  int SNOWMAN_Detect_ApplyFrontend(SNOWMAN_Detect* instance, int apply);
28  int SNOWMAN_Detect_SampleRate(SNOWMAN_Detect* instance);
29  int SNOWMAN_Detect_NumChannels(SNOWMAN_Detect* instance);
30  int SNOWMAN_Detect_BitsPerSample(SNOWMAN_Detect* instance);
31  void SNOWMAN_Detect_Destroy(SNOWMAN_Detect* instance);
32 
33  SNOWMAN_Vad* SNOWMAN_Vad_Create(const char* resource_filename);
34  int SNOWMAN_Vad_Reset(SNOWMAN_Vad* instance);
35  int SNOWMAN_Vad_RunVadWave(SNOWMAN_Vad* instance, const void* data, unsigned int len, int is_end);
36  int SNOWMAN_Vad_RunVadFloat(SNOWMAN_Vad* instance, const float* data, unsigned int num_samples, int is_end);
37  int SNOWMAN_Vad_RunVadShort(SNOWMAN_Vad* instance, const short* data, unsigned int num_samples, int is_end);
38  int SNOWMAN_Vad_RunVadInt(SNOWMAN_Vad* instance, const int* data, unsigned int num_samples, int is_end);
39  int SNOWMAN_Vad_SetAudioGain(SNOWMAN_Vad* instance, float gain);
40  int SNOWMAN_Vad_ApplyFrontend(SNOWMAN_Vad* instance, int apply);
41  int SNOWMAN_Vad_SampleRate(SNOWMAN_Vad* instance);
42  int SNOWMAN_Vad_NumChannels(SNOWMAN_Vad* instance);
43  int SNOWMAN_Vad_BitsPerSample(SNOWMAN_Vad* instance);
44  void SNOWMAN_Vad_Destroy(SNOWMAN_Vad* instance);
45 
46  SNOWMAN_PersonalEnroll* SNOWMAN_PersonalEnroll_Create(const char* resource_filename, const char* model_str);
47  int SNOWMAN_PersonalEnroll_Reset(SNOWMAN_PersonalEnroll* instance);
48  int SNOWMAN_PersonalEnroll_RunEnrollmentWave(SNOWMAN_PersonalEnroll* instance, const void* data, unsigned int len);
49  int SNOWMAN_PersonalEnroll_RunEnrollmentFloat(SNOWMAN_PersonalEnroll* instance, const float* data, unsigned int num_samples);
50  int SNOWMAN_PersonalEnroll_RunEnrollmentShort(SNOWMAN_PersonalEnroll* instance, const short* data, unsigned int num_samples);
51  int SNOWMAN_PersonalEnroll_RunEnrollmentInt(SNOWMAN_PersonalEnroll* instance, const int* data, unsigned int num_samples);
52  int SNOWMAN_PersonalEnroll_GetNumTemplates(SNOWMAN_PersonalEnroll* instance);
53  int SNOWMAN_PersonalEnroll_SampleRate(SNOWMAN_PersonalEnroll* instance);
54  int SNOWMAN_PersonalEnroll_NumChannels(SNOWMAN_PersonalEnroll* instance);
55  int SNOWMAN_PersonalEnroll_BitsPerSample(SNOWMAN_PersonalEnroll* instance);
56  void SNOWMAN_PersonalEnroll_Destroy(SNOWMAN_PersonalEnroll* instance);
57 
58  SNOWMAN_TemplateCut* SNOWMAN_TemplateCut_Create(const char* resource_filename);
59  int SNOWMAN_TemplateCut_Reset(SNOWMAN_TemplateCut* instance);
60  // Returned data needs to get freed using SNOWMAN_free
61  int SNOWMAN_TemplateCut_CutTemplateWave(SNOWMAN_TemplateCut* instance, const void* indata, unsigned int inlen, void** outdata, unsigned int* outlen);
62  int SNOWMAN_TemplateCut_SampleRate(SNOWMAN_TemplateCut* instance);
63  int SNOWMAN_TemplateCut_NumChannels(SNOWMAN_TemplateCut* instance);
64  int SNOWMAN_TemplateCut_BitsPerSample(SNOWMAN_TemplateCut* instance);
65  void SNOWMAN_TemplateCut_Destroy(SNOWMAN_TemplateCut* instance);
66 
67 #ifdef __cplusplus
68 }
69 #endif
Definition: snowboy-detect-c.cpp:13
Definition: snowboy-detect-c.cpp:21
Definition: snowboy-detect-c.cpp:25
Definition: snowboy-detect-c.cpp:17