DEV Community

voicute
voicute

Posted on

What Is ONNX? Where Can a Custom Wake-Word Model Run?

ONNX is a portable model format. It helps move a trained wake-word model between compatible inference runtimes, but an ONNX file is not a complete voice assistant and it cannot be installed into every consumer device.

ONNX in simple terms

ONNX, or Open Neural Network Exchange, describes a neural network graph, its weights, and its input/output definitions. An inference runtime loads the file and executes the model on a CPU, mobile device, desktop computer, browser, or edge system.

For a custom wake word, the complete pipeline is usually:

Microphone → audio preprocessing → Mel features → ONNX model
           → threshold and false-trigger filtering → application action
Enter fullscreen mode Exit fullscreen mode

The ONNX file only represents the model. Audio capture, feature extraction, thresholds, consecutive-frame confirmation, cooldowns, and device actions belong to the surrounding application.

Wake words are not the same as ASR

Keyword spotting (KWS) answers a narrow question: did one of these fixed phrases occur? Automatic speech recognition (ASR) converts open-ended speech into text.

KWS / wake word ASR
Task Detect fixed phrases Transcribe speech
Typical size KB to hundreds of KB Tens to hundreds of MB
Runtime Always-on, low latency Usually starts after wake-up
Use cases Wake words and fixed commands Open-ended dictation and conversation

If a product only needs a wake word or a small set of commands, KWS can be much smaller, faster, and easier to keep offline than a full ASR system.

Where can an ONNX wake-word model run?

Platform Typical runtime Practical use
Android ONNX Runtime or TFLite Local app listening and offline controls
Linux / Raspberry Pi ONNX Runtime, Python, or C++ Gateways, robots, desktop devices, and local automation
Windows / macOS ONNX Runtime Desktop tools and test applications
Web ONNX Runtime Web with WASM/WebGL Browser demos and web applications with microphone permission
iPhone iOS runtime or Core ML integration Possible inside an app; it does not replace Siri
Home Assistant Wyoming or an external local service A custom wake-word path for your own Home Assistant setup

What about ESP32?

ESP32-S3 is an important exception. In practice, you normally do not copy a desktop ONNX file onto the microcontroller and run a full ONNX Runtime. Instead, convert and quantize the model to INT8 TFLite and use TensorFlow Lite Micro or another embedded runtime.

The accurate statement is that one training result can target multiple deployment formats. Android, Linux, and Web may use ONNX, while ESP32-S3 generally uses an INT8 TFLite version.

Can Alexa, Google Home, or Siri use a custom wake word?

Not by installing an ordinary ONNX file. Existing Amazon Echo, Google Home/Nest, and Siri products control their own microphone and wake-word pipeline. A user cannot arbitrarily replace the factory wake word with a custom model.

The model can run in an Android app, a Raspberry Pi gateway, an ESP32-S3 device, or hardware that you control. That external system can then call Home Assistant, SwitchBot, Nature Remo, or another API.

Portable inference and permission to modify a consumer product firmware are two different things.

How to use ONNX as a wake-word model

  1. Define the wake word or fixed commands and generate an ONNX or TFLite model.
  2. Choose the target device and audio-capture path.
  3. Connect the inference runtime and calculate the Mel features expected by the model.
  4. Add thresholds, consecutive-frame confirmation, cooldowns, and false-trigger protection.
  5. Start ASR after the wake word, or map the detected label directly to a fixed action.

The open-source onnx-wakeword project includes examples for Android, Web, Python, desktop, and embedded deployment. Always validate recall and false activations with the final microphone, distance, enclosure, and background noise.

Getting a custom model

Teams with an ML workflow can prepare positive and negative data, train a KWS model, and export the target formats themselves. For faster product validation, Voicute lets you enter a keyword, generate a custom model, and download it for local deployment.

The important distinction is simple: ONNX makes model deployment more portable; it does not make every device installable or every factory wake word customizable.

Generate and test a custom wake-word model at Voicute.

Top comments (0)