repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

fix(noko): recover long transcriptions

00b6c71ab5e743790f0f61d3cbb02c850c395293

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

+13 / −2 text lines

Diff layout

quickshell/nuguland/Noko.qml

Modified

+2 / −1 text lines

252252 listening = false;
253253 transcribing = false;
254254 finished = false;
255 ready = false;
255 if (phase !== "capture" && phase !== "transcribe")
256 ready = false;
256257 lastError = String(text || phase).trim() || phase;
257258 status = "error";
258259 }

quickshell/nuguland/noko.js

Modified

+1 / −1 text lines

127127 hangover--;
128128 } else {
129129 inSpeech = false;
130 pre = [list[i]];
130 pre = [{ frame: list[i], index: i }];
131131 onset = [];
132132 }
133133 continue;

quickshell/nuguland/noko.test.js

Modified

+10 / −0 text lines

4545assert.deepStrictEqual(gated.frameIndexes, [0, 1, 2, 3]);
4646assert.deepStrictEqual(Array.from(gated.samples), [0, 1, 2, 3]);
48// A second speech burst after hangover must preserve typed pre-roll entries.
49const twoBursts = N.vadGate([0, 1, 2, 3, 4, 5, 6, 7].map(v => new Float32Array([v])), [0, 0.4, 0.5, 0, 0, 0.4, 0.5, 0], {
50 threshold: 0.3,
51 preRoll: 1,
52 onset: 2,
53 hangover: 1
54});
55assert.deepStrictEqual(twoBursts.frameIndexes, [0, 1, 2, 3, 4, 5, 6, 7]);
56assert.deepStrictEqual(Array.from(twoBursts.samples), [0, 1, 2, 3, 4, 5, 6, 7]);
4858// postprocess: trim, collapse spaces, remove junk tokens.
4959assert.strictEqual(N.postprocess(' hello <unk> world ', ['<unk>']), 'hello world');