wox.core/util/speech/README.md
Dictation uses sherpa-onnx through its C API, loaded on demand when dictation first starts. Native executables are published by Wox-launcher/Wox.Dictation.Native.Dependecies; Wox authenticates its Ed25519-signed release manifest, verifies archive and file SHA-256 digests, and verifies macOS code signatures before calling dlopen.
Do not import github.com/k2-fsa/sherpa-onnx-go/sherpa_onnx directly here. That package links sherpa-onnx-c-api and onnxruntime at build time, which makes Wox depend on those native libraries during process startup. Dictation is optional, so Wox should start without loading or resolving sherpa/onnxruntime.
The flow is:
speech downloads the platform archive and signed manifest from the Wox dependency release on first use..wox/runtime/onnxruntime/<version>/<goos>-<goarch> and .wox/runtime/sherpa-onnx/<version>/<goos>-<goarch>, with the signed manifest cached beside the sherpa-onnx files. The Silero VAD model is stored under .wox/models/dictation/silero-vad. Existing caches without valid metadata are replaced.speech calls LoadLibraryExW on Windows or dlopen on macOS/Linux the first time a recognizer or VAD is created.Native libraries are intentionally not unloaded. ONNX Runtime and sherpa keep process-wide state; unloading and reloading them is riskier than keeping the library images mapped after first use.