From ca1c0e35b13704d718cc924e50068888a5e9780b Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 9 Nov 2023 01:30:54 +0200 Subject: [PATCH] TTS: force speak on first message in new chat --- public/scripts/extensions/tts/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/scripts/extensions/tts/index.js b/public/scripts/extensions/tts/index.js index 30386c7c6..d57a53e90 100644 --- a/public/scripts/extensions/tts/index.js +++ b/public/scripts/extensions/tts/index.js @@ -122,6 +122,12 @@ async function moduleWorker() { ) { currentMessageNumber = context.chat.length ? context.chat.length : 0 saveLastValues() + + // Force to speak on the first message in the new chat + if (context.chat.length === 1) { + lastMessageHash = -1; + } + return } @@ -771,7 +777,7 @@ export async function initVoiceMap(){ // Clear existing voiceMap state $('#tts_voicemap_block').empty() voiceMapEntries = [] - + // Get characters in current chat const characters = getCharacters()