diff --git a/main/audio.c b/main/audio.c index 2a3fdf2a..a747de97 100644 --- a/main/audio.c +++ b/main/audio.c @@ -97,7 +97,7 @@ static void play_audio_err(void *data) esp_audio_play(hdl_ea, AUDIO_CODEC_TYPE_DECODER, "spiffs://spiffs/user/audio/error.wav", 0); } -void play_audio_ok(void *data) +static void play_audio_ok(void *data) { gpio_set_level(get_pa_enable_gpio(), 1); esp_audio_play(hdl_ea, AUDIO_CODEC_TYPE_DECODER, "spiffs://spiffs/user/audio/success.wav", 0); @@ -132,6 +132,15 @@ static void play_audio_wis_tts(void *data) free(url); } +void play_wake_confirmation(void *data) +{ + es7210_set_mute(true); + gpio_set_level(get_pa_enable_gpio(), 1); + esp_audio_sync_play(hdl_ea, "spiffs://spiffs/user/audio/success.wav", 0); + es7210_set_mute(false); + gpio_set_level(get_pa_enable_gpio(), 0); +} + static void noop(void *data) { } @@ -370,7 +379,7 @@ static esp_err_t cb_ar_event(audio_rec_evt_t *are, void *data) } if (!config_get_bool("multiwake", false)) { if (config_get_bool("wake_confirmation", DEFAULT_WAKE_CONFIRMATION)) { - play_audio_ok(NULL); + play_wake_confirmation(NULL); } } // win by default so in case WAS multiwake handling goes wrong we act normally diff --git a/main/audio.h b/main/audio.h index 3761df67..a48d7514 100644 --- a/main/audio.h +++ b/main/audio.h @@ -23,5 +23,5 @@ extern struct willow_audio_response war; void deinit_audio(void); void init_audio(void); -void play_audio_ok(void *data); +void play_wake_confirmation(void *data); esp_err_t volume_set(int volume); diff --git a/main/was.c b/main/was.c index d6ce9ee0..d163f079 100644 --- a/main/was.c +++ b/main/was.c @@ -81,7 +81,7 @@ static void IRAM_ATTR cb_ws_event(const void *arg_evh, const esp_event_base_t *b audio_recorder_trigger_stop(hdl_ar); goto cleanup; } else if (config_get_bool("wake_confirmation", DEFAULT_WAKE_CONFIRMATION)) { - play_audio_ok(NULL); + play_wake_confirmation(NULL); } } }