diff --git a/index.html b/index.html index 918963b..c867b57 100644 --- a/index.html +++ b/index.html @@ -3292,6 +3292,7 @@ persist_session: true, speech_synth: 0, //0 is disabled beep_on: false, + narrate_both_sides: false, image_styles: "", grammar:"", tokenstreammode: (localflag?1:0), //0=off,1=pollstream,2=sse @@ -7002,6 +7003,7 @@ document.getElementById("ttsselect").innerHTML = ttshtml; document.getElementById("ttsselect").value = localsettings.speech_synth; document.getElementById("beep_on").checked = localsettings.beep_on; + document.getElementById("narrate_both_sides").checked = localsettings.narrate_both_sides; toggle_opmode(); //sd models display @@ -7178,6 +7180,7 @@ localsettings.speech_synth = document.getElementById("ttsselect").value; localsettings.beep_on = (document.getElementById("beep_on").checked?true:false); + localsettings.narrate_both_sides = (document.getElementById("narrate_both_sides").checked?true:false); localsettings.auto_ctxlen = (document.getElementById("auto_ctxlen").checked ? true : false); localsettings.auto_genamt = (document.getElementById("auto_genamt").checked ? true : false); @@ -7901,9 +7904,12 @@ idle_timer = 0; idle_triggered_counter = 0; if (localsettings.speech_synth > 0 && 'speechSynthesis' in window) { - let utterance = new window.SpeechSynthesisUtterance(newgen); - utterance.voice = window.speechSynthesis.getVoices()[localsettings.speech_synth - 1]; - window.speechSynthesis.speak(utterance); + if(localsettings.narrate_both_sides) + { + let utterance = new window.SpeechSynthesisUtterance(newgen); + utterance.voice = window.speechSynthesis.getVoices()[localsettings.speech_synth - 1]; + window.speechSynthesis.speak(utterance); + } } if (localsettings.opmode == 4) @@ -9181,6 +9187,7 @@ } } + let gentxtspeak = gentxt; if (pending_context_preinjection != "") { if(gentxt!="" && gentxt[0]!=" " && localsettings.opmode==3) { @@ -9191,8 +9198,13 @@ pending_context_preinjection = ""; } - if (localsettings.speech_synth > 0 && 'speechSynthesis' in window) { - let utterance = new window.SpeechSynthesisUtterance(gentxt); + if (localsettings.speech_synth > 0 && 'speechSynthesis' in window) + { + if(localsettings.narrate_both_sides) + { + gentxtspeak = gentxt; + } + let utterance = new window.SpeechSynthesisUtterance(gentxtspeak); utterance.voice = window.speechSynthesis.getVoices()[localsettings.speech_synth - 1]; window.speechSynthesis.speak(utterance); } @@ -12041,6 +12053,10 @@ +
+
Narrate Both Sides
+ +
Beep on Done