Checkpoint current interactive fiction state

This commit is contained in:
2026-05-14 21:17:43 +02:00
parent c745efd1d2
commit 873049f7e6
183 changed files with 13755 additions and 1459 deletions
+11 -5
View File
@@ -185,15 +185,21 @@
window.KokoroLoader.instance.generate(data.text, { voice: data.voice, speed: data.speed })
.then(result => {
log(`Generation successful for request ${data.id}`, 'success');
// Convert the result to a proper format for the parent window
const audio = new Uint8Array(result.buffer);
// Kokoro returns a Uint8Array directly, not an object with .buffer
const audio = result instanceof Uint8Array ? result : new Uint8Array(result.buffer || result);
log(`Audio data: ${audio.length} bytes (Uint8Array)`);
// Create a copy of the underlying ArrayBuffer
const bufferCopy = audio.buffer.slice(0);
log(`Sending audio buffer: ${bufferCopy.byteLength} bytes`);
window.parent.postMessage({
type: 'kokoro-generated',
id: data.id,
success: true,
result: { buffer: audio.buffer }
result: { buffer: bufferCopy },
duration: 0 // Duration not provided by Kokoro, will be estimated
}, '*');
})
.catch(error => {