refac: audio

This commit is contained in:
Timothy J. Baek
2024-06-07 20:51:53 -07:00
parent 16615010f7
commit 27417dd771
4 changed files with 23 additions and 16 deletions
@@ -279,15 +279,23 @@
)
?.at(0) ?? undefined;
console.log(voice);
const speak = new SpeechSynthesisUtterance(message.content);
console.log(speak);
speak.onend = () => {
speaking = null;
if ($settings.conversationMode) {
document.getElementById('voice-input-button')?.click();
}
};
speak.voice = voice;
if (voice) {
speak.voice = voice;
}
speechSynthesis.speak(speak);
}
}, 100);