feat: Support for running two wakenet model at same time

This commit is contained in:
xysun 2023-07-19 19:46:02 +08:00
parent 455314a90c
commit 474feb35d7
5 changed files with 6 additions and 2 deletions

View File

@ -64,7 +64,8 @@ typedef struct {
bool voice_communication_agc_init; // AGC swich for voice communication
int voice_communication_agc_gain; // AGC gain(dB) for voice communication
vad_mode_t vad_mode; // The value can be: VAD_MODE_0, VAD_MODE_1, VAD_MODE_2, VAD_MODE_3, VAD_MODE_4
char *wakenet_model_name; // The model name of wakenet
char *wakenet_model_name; // The model name of wakenet 1
char *wakenet_model_name_2; // The model name of wakenet 2 if has wakenet 2
det_mode_t wakenet_mode;
afe_sr_mode_t afe_mode;
int afe_perferred_core;
@ -89,6 +90,7 @@ typedef struct {
.voice_communication_agc_gain = 15, \
.vad_mode = VAD_MODE_3, \
.wakenet_model_name = NULL, \
.wakenet_model_name_2 = NULL, \
.wakenet_mode = DET_MODE_90, \
.afe_mode = SR_MODE_HIGH_PERF, \
.afe_perferred_core = 0, \
@ -114,6 +116,7 @@ typedef struct {
.voice_communication_agc_gain = 15, \
.vad_mode = VAD_MODE_3, \
.wakenet_model_name = NULL, \
.wakenet_model_name_2 = NULL, \
.wakenet_mode = DET_MODE_2CH_90, \
.afe_mode = SR_MODE_LOW_COST, \
.afe_perferred_core = 0, \

View File

@ -27,6 +27,7 @@ typedef struct afe_fetch_result_t
int data_size; // the size of data. The unit is byte.
wakenet_state_t wakeup_state; // the value is wakenet_state_t
int wake_word_index; // if the wake word is detected. It will store the wake word index which start from 1.
int wakenet_model_index; // if there are multiple wakenets, this value identifies which model be wakes up. Index start from 1.
afe_vad_state_t vad_state; // the value is afe_vad_state_t
int trigger_channel_id; // the channel index of output
int wake_word_length; // the length of wake word. It's unit is the number of samples.
@ -111,7 +112,7 @@ typedef int (*esp_afe_sr_iface_op_reset_buffer_t)(esp_afe_sr_data_t *afe);
/**
* @brief Initial wakenet and wake words coefficient, or reset wakenet and wake words coefficient
* when wakenet has been initialized.
* when wakenet has been initialized. It's only support wakenet 1 now.
*
* @param afe The AFE_SR object to query
* @param wakenet_word The wakenet word, should be DEFAULT_WAKE_WORD or EXTRA_WAKE_WORD

Binary file not shown.

Binary file not shown.

Binary file not shown.