<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: voicute</title>
    <description>The latest articles on DEV Community by voicute (@buguatec).</description>
    <link>https://dev.to/buguatec</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4072257%2F541cd7b4-4417-4970-86b8-58dcfc9cf307.png</url>
      <title>DEV Community: voicute</title>
      <link>https://dev.to/buguatec</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/buguatec"/>
    <language>en</language>
    <item>
      <title>Building a Small Multilingual Offline Voice-Control Pipeline with ONNX</title>
      <dc:creator>voicute</dc:creator>
      <pubDate>Mon, 12 Oct 2026 19:44:34 +0000</pubDate>
      <link>https://dev.to/buguatec/building-a-small-multilingual-offline-voice-control-pipeline-with-onnx-14i5</link>
      <guid>https://dev.to/buguatec/building-a-small-multilingual-offline-voice-control-pipeline-with-onnx-14i5</guid>
      <description>&lt;p&gt;Many products do not need a full speech-to-text system to support voice control.&lt;/p&gt;

&lt;p&gt;A smart switch may only need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one wake phrase;&lt;/li&gt;
&lt;li&gt;“turn the light on”;&lt;/li&gt;
&lt;li&gt;“turn the light off”;&lt;/li&gt;
&lt;li&gt;“brighter”;&lt;/li&gt;
&lt;li&gt;“dimmer”.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For this kind of fixed vocabulary, keyword spotting (KWS) can be a better fit than running a general ASR model all the time.&lt;/p&gt;

&lt;p&gt;This article explains the pipeline we use for small offline keyword models, what KWS can and cannot do, and how the same model can move from a browser test to an embedded product.&lt;/p&gt;

&lt;h2&gt;
  
  
  KWS is not ASR
&lt;/h2&gt;

&lt;p&gt;ASR answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What did the user say?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;KWS answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did one of the phrases I care about occur in this audio stream?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The processing paths are different:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ASR:
audio → speech-to-text → text matching / intent parsing → action

KWS:
audio → acoustic features → keyword model → command id → action
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the command set is small and predefined, KWS avoids a large transcription model and a second text-matching layer.&lt;/p&gt;

&lt;p&gt;KWS is not a replacement for free-form speech. If users need to say things such as “set the living-room light to 50 percent”, the product will usually need ASR and intent parsing for the room and numeric value.&lt;/p&gt;

&lt;h2&gt;
  
  
  The runtime pipeline
&lt;/h2&gt;

&lt;p&gt;Our offline runtime follows this shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;microphone frames
      ↓
audio buffering
      ↓
Mel features
      ↓
keyword model
      ↓
matched keyword outputs
      ↓
consecutive-frame and false-trigger logic
      ↓
application callback
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model is only one part of a usable always-listening system. A raw score should not automatically trigger a product action. The runtime also needs temporal confirmation, cooldown handling, background-energy checks, and application-level state handling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use a small model?
&lt;/h2&gt;

&lt;p&gt;The model is expected to run continuously while the product is waiting for a command. Size and compute affect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RAM and flash requirements;&lt;/li&gt;
&lt;li&gt;battery life;&lt;/li&gt;
&lt;li&gt;wake-up latency;&lt;/li&gt;
&lt;li&gt;the cost of keeping the main processor active;&lt;/li&gt;
&lt;li&gt;whether the model fits on a microcontroller.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The demo models in our open runtime are designed for small-footprint deployment. The repository includes ONNX paths for Python, Web and Android, plus an INT8 TFLite path for ESP32-S3.&lt;/p&gt;

&lt;p&gt;The exact result still depends on the audio front end and target device. A desktop result should not be presented as an ESP32 result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-keyword models
&lt;/h2&gt;

&lt;p&gt;A product may need a wake phrase and several commands. Instead of loading a separate model for every phrase, a multi-keyword model can expose several outputs from one inference pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Hey Lamp"       → WAKE
"Turn it on"     → LIGHT_ON
"Turn it off"    → LIGHT_OFF
"Brighter"       → BRIGHTER
"Dimmer"         → DIMMER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This does not remove the need for testing. Similar-sounding phrases can interfere with one another, and each output can have a different recall/false-trigger trade-off.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we test before shipping
&lt;/h2&gt;

&lt;p&gt;For a real product, “the model triggered once in a demo” is not enough. We measure at least:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;true-trigger recall;&lt;/li&gt;
&lt;li&gt;false activations per hour;&lt;/li&gt;
&lt;li&gt;distance and speaking volume;&lt;/li&gt;
&lt;li&gt;different speakers and accents;&lt;/li&gt;
&lt;li&gt;TV, music, fan and room noise;&lt;/li&gt;
&lt;li&gt;model size and device memory;&lt;/li&gt;
&lt;li&gt;end-to-end latency and power impact.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Recall and false activation rate must be considered together. Lowering a threshold can make a model easier to trigger while also increasing false activations.&lt;/p&gt;

&lt;h2&gt;
  
  
  From a phrase to a device test
&lt;/h2&gt;

&lt;p&gt;For teams without a speech ML group, a practical validation workflow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;define the exact fixed phrases;&lt;/li&gt;
&lt;li&gt;generate a first model;&lt;/li&gt;
&lt;li&gt;test it with real speakers before downloading;&lt;/li&gt;
&lt;li&gt;run it on the target microphone and device;&lt;/li&gt;
&lt;li&gt;collect misses and false activations;&lt;/li&gt;
&lt;li&gt;add real-voice samples or hard negatives when needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Voicute is the online training and testing part of this workflow. The &lt;code&gt;onnx-wakeword&lt;/code&gt; repository contains the open offline runtime and platform examples.&lt;/p&gt;

&lt;p&gt;The important distinction is that online testing reduces the risk of downloading the wrong model; it does not replace validation on the final hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this architecture is a good fit
&lt;/h2&gt;

&lt;p&gt;Use a small KWS pipeline when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the vocabulary is fixed;&lt;/li&gt;
&lt;li&gt;the device needs local or offline operation;&lt;/li&gt;
&lt;li&gt;the device is battery-powered or resource-constrained;&lt;/li&gt;
&lt;li&gt;low latency matters;&lt;/li&gt;
&lt;li&gt;the product does not want to send continuous audio to a cloud service.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use ASR and intent parsing when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;users can express the same intent in many ways;&lt;/li&gt;
&lt;li&gt;commands contain open values, numbers or entities;&lt;/li&gt;
&lt;li&gt;the product is closer to a conversational interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disclosure: I’m the creator of Voicute. The model-generation service is commercial, while the offline inference runtime and integration examples are open source. The claims above should be validated on the reader’s own microphone, language and target device.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>iot</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>I built a portable keyword spotting engine — started with Chinese, now supporting English</title>
      <dc:creator>voicute</dc:creator>
      <pubDate>Tue, 11 Aug 2026 04:16:05 +0000</pubDate>
      <link>https://dev.to/buguatec/i-built-a-portable-keyword-spotting-engine-started-with-chinese-now-supporting-english-d10</link>
      <guid>https://dev.to/buguatec/i-built-a-portable-keyword-spotting-engine-started-with-chinese-now-supporting-english-d10</guid>
      <description>&lt;h1&gt;
  
  
  I built a portable keyword spotting engine — started with Chinese, now supporting English
&lt;/h1&gt;

&lt;p&gt;I wanted offline voice commands for a few Python projects. Nothing fancy — just a single file I could drop in and run.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One Python file&lt;/strong&gt; — &lt;code&gt;wakeword_engine.py&lt;/code&gt;, copy it into your project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Small model&lt;/strong&gt; — ~135KB for 3 keywords, &amp;lt;5ms inference&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-keyword&lt;/strong&gt; — one model detects 2-10 keywords in a single pass&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fully offline&lt;/strong&gt; — no cloud, no internet, ONNX Runtime under the hood&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5-layer noise filtering&lt;/strong&gt; — consecutive frame check, background suppression, cooldown, burst lock, energy jump detection&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Chinese first
&lt;/h2&gt;

&lt;p&gt;Most KWS engines optimize for English. I started with Chinese instead. It's a tonal language with lots of single-syllable words — harder for keyword spotting. No pre-trained English embeddings to lean on either.&lt;/p&gt;

&lt;p&gt;The upside: the architecture (causal TCN on mel spectrograms) doesn't depend on any language-specific pretrained model. Once Chinese worked, English was almost free. Just needed the training data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;onnxruntime numpy pyaudio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;wakeword_engine&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;WakeWordEngine&lt;/span&gt;

&lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WakeWordEngine&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;model_info.json&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;melspectrogram.onnx&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_L1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prob&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;prob&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What's working now
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;✅ mature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Web (ONNX Runtime Web)&lt;/td&gt;
&lt;td&gt;✅ working&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Android (Java)&lt;/td&gt;
&lt;td&gt;✅ working&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESP32&lt;/td&gt;
&lt;td&gt;🚧 early&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;Wyoming protocol integration for Home Assistant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo&lt;/strong&gt;: &lt;a href="https://github.com/voicute/onnx-wakeword" rel="noopener noreferrer"&gt;github.com/voicute/onnx-wakeword&lt;/a&gt; — MIT license.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>opensource</category>
      <category>python</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
