From 585b023c07f0209fe9cf239665b196607d20af88 Mon Sep 17 00:00:00 2001 From: "Steven B." <4163156+appatalks@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:21:17 -0600 Subject: [PATCH] patch-autospeak lm-studio.js Adding autospeak function --- core/js/lm-studio.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/js/lm-studio.js b/core/js/lm-studio.js index afe4d7c..fd7b969 100644 --- a/core/js/lm-studio.js +++ b/core/js/lm-studio.js @@ -72,6 +72,14 @@ function lmsSend() { openAIMessages.push({ role: "user", content: sQuestion }); openAIMessages.push({ role: "assistant", content: candidate }); localStorage.setItem("openAIMessages", JSON.stringify(openAIMessages)); + + // Check the state of the checkbox and have fun + const checkbox = document.getElementById("autoSpeak"); + if (checkbox.checked) { + speakText(); + const audio = document.getElementById("audioPlayback"); + audio.setAttribute("autoplay", true); + } }) .catch(error => { console.error("Error:", error);