Skip to content

Commit

Permalink
patch-autospeak lm-studio.js
Browse files Browse the repository at this point in the history
Adding autospeak function
  • Loading branch information
appatalks authored Dec 26, 2024
1 parent 799b0c5 commit 585b023
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/js/lm-studio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 585b023

Please sign in to comment.