Update speak.js

This commit is contained in:
uukelele 2025-08-22 20:50:16 +01:00 committed by GitHub
parent 8272be81f3
commit 567f3e0ab4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,8 +53,8 @@ $s.Speak('${txt.replace(/'/g,"''")}'); $s.Dispose()"`
try { try {
let audioData = await sendAudioRequest(txt, mdl, voice, url); let audioData = await sendAudioRequest(txt, mdl, voice, url);
if (!audioData) { if (!audioData) {
audioData = "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU5LjI3LjEwMAAAAAAAAAAAAAAA/+NAwAAAAAAAAAAAAEluZm8AAAAPAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAExhdmM1OS4zNwAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAeowAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="; throw new Error("TTS model did not return audio data");
// ^ 0 second silent audio clip // will be handled below
} }
if (isWin) { if (isWin) {
@ -80,7 +80,7 @@ $s.Speak('${txt.replace(/'/g,"''")}'); $s.Dispose()"`
} }
} catch (e) { } catch (e) {
console.error('Audio error', e); console.error('[TTS] Audio error', e);
processQueue(); processQueue();
} }
} }