modified: uncloseai.js
This commit is contained in:
parent
c44eb6ffcd
commit
ada3297b59
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
})
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue