From ada3297b5936367ca0ee747ea26eef5b990faa53 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Dec 2024 14:12:40 +0000 Subject: [PATCH] modified: uncloseai.js --- uncloseai.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uncloseai.js b/uncloseai.js index 27f5fca..f0466e2 100644 --- a/uncloseai.js +++ b/uncloseai.js @@ -81,6 +81,9 @@ function extractWebpageContent() { // Function to read text using TTS async function speakText(text, voice = 'alloy', rate = 0.9) { try { + // Preprocess the text using Hermes to get spoken tokens + const spokenText = await processContentWithHermes(text); + const response = await fetch(TTS_API_URL, { method: 'POST', headers: { @@ -90,7 +93,7 @@ async function speakText(text, voice = 'alloy', rate = 0.9) { body: JSON.stringify({ model: 'tts-1', voice: voice, - input: text + input: spokenText }) });