diff --git a/openrtx/include/core/voicePromptUtils.h b/openrtx/include/core/voicePromptUtils.h index 10908fdf..d15e96ec 100644 --- a/openrtx/include/core/voicePromptUtils.h +++ b/openrtx/include/core/voicePromptUtils.h @@ -193,6 +193,12 @@ void vp_announceSettingsTimeDate(); */ void vp_announceSettingsVoiceLevel(const vpQueueFlags_t flags); +/** + * This is called to speak generic settings on/off toggles. + */ +void vp_announceSettingsOnOffToggle(const char* const* stringTableStringPtr, + const vpQueueFlags_t flags, bool val); + /** * */ diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index d5cb6d1f..cd8fbc05 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -718,6 +718,19 @@ void vp_announceSettingsVoiceLevel(const vpQueueFlags_t flags) playIfNeeded(flags); } +void vp_announceSettingsOnOffToggle(const char* const* stringTableStringPtr, + const vpQueueFlags_t flags, bool val) +{ + clearCurrPromptIfNeeded(flags); + + if (flags & vpqIncludeDescriptions) + vp_queueStringTableEntry(stringTableStringPtr); + + vp_queueStringTableEntry(val ? ¤tLanguage->on : ¤tLanguage->off); + + playIfNeeded(flags); +} + vpQueueFlags_t vp_getVoiceLevelQueueFlags() { uint8_t vpLevel = state.settings.vpLevel; diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 1d80b06c..b3a4b556 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -759,6 +759,10 @@ static void _ui_changeVoiceLevel(int variation) static void _ui_changePhoneticSpell(bool newVal) { state.settings.vpPhoneticSpell = newVal ? 1 : 0; + + vp_announceSettingsOnOffToggle(¤tLanguage->phonetic, + vp_getVoiceLevelQueueFlags(), + state.settings.vpPhoneticSpell); } static bool _ui_checkStandby(long long time_since_last_event)