Optimising the default for an average laptop, not more CPU (the speech model is hard-wired to 4 threads in NeMo-Speech.cpp, session.cpp:911 — already a thin-client budget). - RECONNECT: a live recording ended with "speech server connection lost: … broken pipe" when the stream to the speech server broke. Now the engine opens a new stream and keeps going; the words still in flight on the old one are finalised so the box keeps them; up to 5 attempts, then a plain message. Verified against a fake speech server that drops the first stream after 3 s: 6 words finalised, reconnected in 2 ms, 14 more words streamed, clean Stop, 0 data races (go -race). - FALLING BEHIND: when the mic clearly carries speech but no words have come back for 10 s (the server is starved of CPU — the stream used to freeze with no message), say so once; it clears when words resume. Verified with a fake server that returns no words: warned after 10 s. - The robot voice (Piper) runs at nice 10 on Linux, so its ~1 s burst per sentence never makes the words you are speaking fall behind.
15 lines
490 B
Go
15 lines
490 B
Go
//go:build !linux
|
|
|
|
package main
|
|
|
|
import "syscall"
|
|
|
|
// childAttr: macOS and Windows have no parent-death signal. In the desktop app the Tauri shell owns the
|
|
// engine's lifetime and the engine kills its children on a normal exit (shutdown); a crashed engine can
|
|
// leave its speech server running until the app is next closed.
|
|
func childAttr() *syscall.SysProcAttr {
|
|
return nil
|
|
}
|
|
|
|
// yieldCPU: best effort only on Linux (see procattr_linux.go); elsewhere a no-op.
|
|
func yieldCPU(pid int) {}
|