diff --git a/openrtx/include/core/voicePromptUtils.h b/openrtx/include/core/voicePromptUtils.h index 01ea122d..c2b2b7eb 100644 --- a/openrtx/include/core/voicePromptUtils.h +++ b/openrtx/include/core/voicePromptUtils.h @@ -65,6 +65,8 @@ void announceContactWithIndex(uint16_t index, VoicePromptQueueFlags_T flags); void announceTimeslot(uint8_t timeslot, VoicePromptQueueFlags_T flags); void announceColorCode(uint8_t rxColorCode, uint8_t txColorCode, VoicePromptQueueFlags_T flags); void announceBank(uint16_t bank, VoicePromptQueueFlags_T flags); +void announceM17Info(channel_t* channel, VoicePromptQueueFlags_T flags); + VoicePromptQueueFlags_T GetQueueFlagsForVoiceLevel(); #endif //VOICE_PROMPT_UTILS_H_INCLUDED \ No newline at end of file diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index f4509dbb..c3bc7f02 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -203,14 +203,7 @@ VoicePromptQueueFlags_T flags) } else if (channel->mode == OPMODE_M17) { - if (state.m17_data.dst_addr[0]) - { - if (localFlags & vpqIncludeDescriptions) - vpQueuePrompt(PROMPT_DEST_ID); - vpQueueString(state.m17_data.dst_addr, vpAnnounceCommonSymbols); - } - else if (channel->m17.contact_index) - announceContactWithIndex(channel->m17.contact_index, localFlags); + announceM17Info(channel, localFlags); } else if (channel->mode == OPMODE_DMR) { @@ -433,7 +426,24 @@ void announceBank(uint16_t bank, VoicePromptQueueFlags_T flags) vpQueueString(bank_hdr.name, vpAnnounceCommonSymbols); } else - vpQueueStringTableEntry(currentLanguage->allChannels); + vpQueueStringTableEntry(¤tLanguage->allChannels); + + vpPlayIfNeeded(flags); +} + +void announceM17Info(channel_t* channel, VoicePromptQueueFlags_T flags) +{ + if (!channel) return; + + vpInitIfNeeded(flags); + if (state.m17_data.dst_addr[0]) + { + if (flags & vpqIncludeDescriptions) + vpQueuePrompt(PROMPT_DEST_ID); + vpQueueString(state.m17_data.dst_addr, vpAnnounceCommonSymbols); + } + else if (channel->m17.contact_index) + announceContactWithIndex(channel->m17.contact_index, flags); vpPlayIfNeeded(flags); }