Update Readme.md + Documentaion.md

This commit is contained in:
2026-05-12 19:35:28 +02:00
parent 90e4390d1a
commit 1fd6418628
2 changed files with 24 additions and 7 deletions

View File

@@ -52,7 +52,21 @@
let transferer = await module.createTransferer(ctx, 128 * 150);
// Recognize data on arrival
transferer.port.onmessage = ev => recognizer.acceptWaveform(ev.data);
transferer.port.onmessage = ev => {
const raw = recognizer.acceptWaveform(ev.data);
if (!raw) return;
const msg = JSON.parse(raw);
if (msg.partial) {
console.log("Partial:", msg.partial);
}
if (msg.text) {
console.log("Result:", msg.text);
}
};
// Connect transferer to microphone
micNode.connect(transferer);