From 3c20a5282e8bbdbe7014eb88d3fd8478dcbc36aa Mon Sep 17 00:00:00 2001 From: vk7js <58905135+vk7js@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:41:55 +1000 Subject: [PATCH] Fixed nasty popping between every voice prompt and after every silence. When retrieving the codec2 data, ensure it is an exact multiple of codec2 frames and always discard the very last frame. --- openrtx/src/core/voicePrompts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openrtx/src/core/voicePrompts.c b/openrtx/src/core/voicePrompts.c index 90b72edc..2c2360c3 100644 --- a/openrtx/src/core/voicePrompts.c +++ b/openrtx/src/core/voicePrompts.c @@ -488,8 +488,8 @@ void vp_tick() vpCurrentSequence.c2DataIndex = 0; vpCurrentSequence.c2DataStart = tableOfContents[promptNumber]; - vpCurrentSequence.c2DataLength = tableOfContents[promptNumber + 1] - - tableOfContents[promptNumber]; + vpCurrentSequence.c2DataLength = ((tableOfContents[promptNumber + 1] + - tableOfContents[promptNumber])/8 * 8); } while (vpCurrentSequence.c2DataIndex < vpCurrentSequence.c2DataLength)