modified: uncloseai.js

This commit is contained in:
root 2024-12-09 14:12:40 +00:00
parent c44eb6ffcd
commit ada3297b59

View file

@ -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
})
});