Fix: Voice-Auto-Naming tot (TitaNet bricht bei langen Schnitten ab + vergiftete Promise-Kette)

identifySpeakers() embettete den laengsten Lauf ungekuerzt; TitaNet-ONNX bricht
ab 180 s ab (broadcast 12288 by 17998) und riss den spk_embed-Helfer mit. Da
spk.js die Aufrufe ueber eine Promise-Kette serialisiert, schlugen danach ALLE
weiteren Sprecher mit 'spk beendet' fehl.

- ID_CUT_SEC=25s in identifySpeakers
- Kette in spk.js und tdChain in recorder.js failure-isoliert
- pro Name gewinnt nur der beste Kosinus (Fabio war auf 2 Clustern)
This commit is contained in:
Claude
2026-07-27 17:30:43 +02:00
parent 48fa6b4f9e
commit 61531fc50a
5 changed files with 56 additions and 9 deletions
+11 -2
View File
@@ -47,12 +47,21 @@ function start() {
}
// Extract the voiceprint for a 16 kHz mono wav file.
// Calls are serialized through `chain`, but a FAILED call must not poison it:
// .then() on a rejected promise skips the callback, so ONE crash used to make
// every later embed() fail instantly with the same "spk beendet" — that is why
// speaker auto-naming was dead for a whole recording after the first bad cut
// (root-caused 2026-07-27). The queue is continued from a swallowed copy.
// NOTE for callers: keep cuts short. onnxruntime ABORTS the helper process on
// very long inputs — reproduced at 180 s ("Non-zero status code returned while
// running Where"), fine at 20/60 s.
export function embed(wavPath) {
chain = chain.then(async () => {
const run = chain.then(async () => {
await start();
return await new Promise((res, rej) => { pending = { resolve: res, reject: rej }; proc.stdin.write(wavPath + '\n'); });
});
return chain;
chain = run.then(() => {}, () => {});
return run;
}
export function cosine(a, b) {