diff --git a/components/audio_recorder/include/recorder_sr_iface.h b/components/audio_recorder/include/recorder_sr_iface.h index ae39279d7..b2e05d73b 100644 --- a/components/audio_recorder/include/recorder_sr_iface.h +++ b/components/audio_recorder/include/recorder_sr_iface.h @@ -40,6 +40,7 @@ extern "C" { typedef struct { float data_volume; /*!< Volume of input audio, the unit is decibel(dB) */ int wake_word_index; /*!< Wake word index which start from 1 */ + int wakenet_model_index; /*!< Wakenets index which start from 1 */ } recorder_sr_wakeup_result_t; /*!< Information when wakeup word detected */ /** diff --git a/components/audio_recorder/recorder_sr.c b/components/audio_recorder/recorder_sr.c index 1606f0c52..93f1b4800 100644 --- a/components/audio_recorder/recorder_sr.c +++ b/components/audio_recorder/recorder_sr.c @@ -133,6 +133,7 @@ static recorder_sr_result_t *recorder_sr_afe_result_convert( sr_result->type = SR_RESULT_WAKEUP; sr_result->info.wakeup_info.data_volume = afe_result->data_volume; sr_result->info.wakeup_info.wake_word_index = afe_result->wake_word_index; + sr_result->info.wakeup_info.wakenet_model_index = afe_result->wakenet_model_index; break; default: break; diff --git a/examples/speech_recognition/wwe/main/main.c b/examples/speech_recognition/wwe/main/main.c index 592f7ab2d..a9c19b037 100644 --- a/examples/speech_recognition/wwe/main/main.c +++ b/examples/speech_recognition/wwe/main/main.c @@ -238,7 +238,7 @@ static esp_err_t rec_engine_cb(audio_rec_evt_t *event, void *user_data) recorder_sr_wakeup_result_t *wakeup_result = event->event_data; ESP_LOGI(TAG, "rec_engine_cb - REC_EVENT_WAKEUP_START"); - ESP_LOGI(TAG, "wakeup: vol %f, idx %d", wakeup_result->data_volume, wakeup_result->wake_word_index); + ESP_LOGI(TAG, "wakeup: vol %f, mod idx %d, word idx %d", wakeup_result->data_volume, wakeup_result->wakenet_model_index, wakeup_result->wake_word_index); esp_audio_sync_play(player, tone_uri[TONE_TYPE_DINGDONG], 0); if (voice_reading) { int msg = REC_CANCEL;