Skip to content

Commit

Permalink
audio: support new wake_work_friendly config property
Browse files Browse the repository at this point in the history
  • Loading branch information
stintel committed Jan 10, 2024
1 parent b7c7333 commit cc7467d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

#define PARTLABEL_SRMODELS "model"
#define MULTINET_TWDT 30
#define STR_WAKE_LEN 25
#define STR_WAKE_LEN 64
#define WIS_URL_TTS_ARG "?format=WAV&speaker=CLB&text="

typedef enum willow_http_stream {
Expand Down Expand Up @@ -1019,7 +1019,11 @@ esp_err_t init_audio(void)
audio_thread_create(&hdl_at, "at_read", at_read, NULL, 4 * 1024, 5, true, 0);

char wake_help[STR_WAKE_LEN] = "";
if (strcmp(wake_word, "hiesp") == 0) {
char *wake_word_friendly = config_get_char("wake_word_friendly", NULL);
if (wake_word_friendly != NULL) {
snprintf(wake_help, STR_WAKE_LEN, "Say '%s' to start!", wake_word_friendly);
free(wake_word_friendly);
} else if (strcmp(wake_word, "hiesp") == 0) {
strncpy(wake_help, "Say 'Hi ESP' to start!", STR_WAKE_LEN);
} else if (strcmp(wake_word, "alexa") == 0) {
strncpy(wake_help, "Say 'Alexa' to start!", STR_WAKE_LEN);
Expand Down

0 comments on commit cc7467d

Please sign in to comment.