Skip to content

Commit

Permalink
Merge branch 'feature/model_idx_in_recorder_event' into 'master'
Browse files Browse the repository at this point in the history
audio_recorder: Add wakenet index in wakeup result

See merge request adf/esp-adf-internal!1239
  • Loading branch information
jason-mao committed Sep 28, 2023
2 parents 5d76d8c + a8aab00 commit ef058da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/audio_recorder/include/recorder_sr_iface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

/**
Expand Down
1 change: 1 addition & 0 deletions components/audio_recorder/recorder_sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion examples/speech_recognition/wwe/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ef058da

Please sign in to comment.