--- license: apache-2.0 library_name: unity-sentis tags: - unity - sentis - on-device - keyword-spotting - wake-word --- # sentis-openwakeword OpenWakeWord wake-word detection converted to **Unity Inference Engine (Sentis)** FP16. ## Files ``` melspectrogram_fp16.sentis # shared mel front end embedding_model_fp16.sentis # shared 96-dim embedding model WakeWord/ # per-word classifier heads (alexa, jarvis, Ronaldo) OpenWakeWord.cs # self-contained Unity Sentis inference ``` ## ⚠️ Wake-word sample models The bundled per-word heads (`alexa`, `jarvis`, `Ronaldo`) are OpenWakeWord **sample** models named after third-party trademarks and a real person. They are included only to demonstrate the detector. **Do not ship them in a product** — train or substitute a neutral custom wake word instead. ## Pipeline Three stacked models, streaming at 16 kHz. It mirrors the reference openWakeWord pipeline: 1. **Mel** — feed the latest `1760` int16-scaled samples (`1280` new + `480` lookback) as `[1, samples]`; it emits 32-bin mel frames. Apply the reference transform `mel = spec / 10 + 2` and append to a mel ring buffer. 2. **Embedding** — take the latest `76` mel frames as `[1, 76, 32, 1]`; it emits one 96-d feature vector (append to a feature ring buffer). 3. **Wake word** — take the latest `N` feature frames as `[1, N, 96]`; reduce-max the output to a single score in `[0, 1]`. Fire when it crosses your threshold (≈0.5), with a debounce. A complete self-contained implementation lives in [`OpenWakeWord.cs`](OpenWakeWord.cs) (chunking, mel + feature ring buffers, the `FunctionalGraph` `ReduceMax` score head, warmup/debounce, and a `Detected` event). Minimal usage: ```csharp var detector = new OpenWakeWord(detectionThreshold: 0.5f); detector.Load(modelRoot); // folder holding the two shared models + WakeWord/alexa_v0.1_fp16.sentis detector.Detected += d => Debug.Log($"{d.Name} {d.Probability:0.00}"); // each frame: push 16 kHz mono samples, then drain detector.PushSamples(micSamples, micSampleCount); detector.Pump(); // call regularly (e.g. once per frame) ``` ## License & attribution Apache-2.0. Converted from [dscripka/openWakeWord](https://github.com/dscripka/openWakeWord) (Apache-2.0).