<?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: d0txyz</title>
    <description>The latest articles on DEV Community by d0txyz (@d0txyz).</description>
    <link>https://dev.to/d0txyz</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%2F4249117%2Faa5279ca-a7d8-4e11-8282-06acd71fe019.png</url>
      <title>DEV Community: d0txyz</title>
      <link>https://dev.to/d0txyz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/d0txyz"/>
    <language>en</language>
    <item>
      <title>Saktah: a Qur'an recitation coach that notices when you breathe mid-phrase</title>
      <dc:creator>d0txyz</dc:creator>
      <pubDate>Tue, 17 Nov 2026 07:13:47 +0000</pubDate>
      <link>https://dev.to/d0txyz/saktah-a-quran-recitation-coach-that-notices-when-you-breathe-mid-phrase-5a55</link>
      <guid>https://dev.to/d0txyz/saktah-a-quran-recitation-coach-that-notices-when-you-breathe-mid-phrase-5a55</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/presage-2026-11-04"&gt;Presage SmartSpectra SDK Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Saktah&lt;/strong&gt; is a desktop app for practising Qur'an recitation one breath at a time.&lt;/p&gt;

&lt;p&gt;In tajwid (the rules of recitation) you may only take a breath where a stop is allowed: at the end of an ayah, or at one of the small pause marks printed above the text. Breathing in the middle of a phrase breaks it, and it is one of the things teachers correct most. In an online class a teacher cannot watch every student's breathing, and on your own you rarely notice you did it.&lt;/p&gt;

&lt;p&gt;Saktah watches through the webcam while you recite. It never listens. When you finish a phrase it tells you one of two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One breath&lt;/strong&gt;: the phrase turns green and the next one comes up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A breath before the stop&lt;/strong&gt;: the phrase turns amber, the breath is marked on a strip under the text ("a breath 2.1 seconds in"), and you try it again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A &lt;em&gt;saktah&lt;/em&gt; (سَكْتَة) is the short pause in recitation taken &lt;em&gt;without&lt;/em&gt; breathing. Pausing is fine; breathing is not. That is exactly the line the app draws, so it is the name.&lt;/p&gt;

&lt;p&gt;You pick any of the 114 surahs and how phrases break: a whole ayah per breath, or a phrase at every permitted stop. At the end you get the phrases you held in one breath on the first try, your longest phrase, and a one-click drill of only the phrases you broke.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/nQpg81jRG68" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Every verdict in the video is from a live session: the green phrases and the amber one are real SmartSpectra readings, not simulated signals. The narration is a synthetic voice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/d0txyz/saktah" rel="noopener noreferrer"&gt;https://github.com/d0txyz/saktah&lt;/a&gt; (setup instructions in the README: &lt;code&gt;npm install&lt;/code&gt;, add your API key, &lt;code&gt;npm start&lt;/code&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Responds to Human Signals
&lt;/h2&gt;

&lt;p&gt;Saktah uses two live SmartSpectra signals together, through the Node.js / Electron SDK (&lt;code&gt;@smartspectra/node-sdk&lt;/code&gt;, renderer-side capture):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Talking detection&lt;/strong&gt; (&lt;code&gt;face.talking&lt;/code&gt;) tells me when a phrase starts and ends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The chest and abdomen breathing traces&lt;/strong&gt; (&lt;code&gt;breathing.upperTrace&lt;/code&gt; / &lt;code&gt;lowerTrace&lt;/code&gt;) tell me when a breath was taken.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I request only what I use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;sdk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SmartSpectraSDK&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;requestedMetrics&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nc"&gt;MetricType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CHEST_BREATHING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;MetricType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ABDOMEN_BREATHING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;MetricType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;BREATHING_RATE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;MetricType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;TALKING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;enableTelemetry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each &lt;code&gt;metrics&lt;/code&gt; event carries the samples since the last one, so I append them into small rolling buffers keyed by the SDK's own capture timestamps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calibration.&lt;/strong&gt; Before practice, two guided slow breaths (a circle grows, you breathe in; it shrinks, you breathe out). Comparing the trace during the "in" and "out" cues tells me which way the trace moves when you inhale on this camera, how big one real breath is, and which of the two traces (chest or abdomen) follows you best.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding breaths.&lt;/strong&gt; The chosen trace is smoothed over 150 ms and run through a zigzag (hysteresis) detector: an inhale is a rise from a trough to the next peak of at least 30% of your calibrated breath, lasting 0.2 to 4 seconds. Speech shows up as a long slow exhale, a breath as a quick rise, so the two are easy to tell apart once the threshold is personal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Judging a phrase.&lt;/strong&gt; The phrase runs from when talking starts to when it stops for good (2.2 s of quiet, or Space). If an inhale's midpoint falls inside that span, it is a breath before the stop. The breath you take &lt;em&gt;at&lt;/em&gt; the stop comes after talking ends, so it never counts against you, and a pause with no rise in the trace (a real saktah) stays clean.&lt;/p&gt;

&lt;p&gt;Everything is matched on the SDK's capture timestamps, not on when events arrive, so processing lag cannot move a breath into or out of a phrase. The detector is plain JavaScript with unit tests for each case: clean phrase, breath mid-phrase, pause without breath, breath at the stop, upside-down trace, noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What the real signal taught me.&lt;/strong&gt; I tuned this on my own recitation in front of an ordinary 1080p webcam, over four live sessions, saving only the trace and talking numbers for each phrase in a developer mode.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The guided breaths matched the cues every time (agreement 1.0). On my framing the chest trace carried the breathing and the abdomen trace stayed nearly empty, which is why the app picks the channel per person instead of assuming one. One calibrated breath came out at roughly 25 times the trace's resting noise, so the personal threshold sits well clear of jitter.&lt;/li&gt;
&lt;li&gt;Talking detection reads the lips, and recitation is full of held vowels (madd) where the lips barely move. Inside one phrase I saw gaps of up to 1.3 seconds. So a phrase runs from the first lip movement to the last, and only 2.2 seconds of stillness ends it.&lt;/li&gt;
&lt;li&gt;The SDK wants 25 frames a second. Sending full 720p frames from the window to the engine fell short, and with a 4:3 640x480 picture the SDK never found my chest. A 16:9 960x540 stream kept the chest in view and the trace steady.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;One honest limitation.&lt;/strong&gt; When I turned my head, lip tracking lost me and saw only a fraction of the phrase. Early on that fraction was scored as a clean phrase. Now a phrase needs a plausible amount of reciting for its length (0.5 s plus 0.15 s per word), and anything less gets "I only saw part of that phrase" and a retry, never a pass. It is also tuned on one reciter so far.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Thoughtful Real-World Use.&lt;/strong&gt; Millions of people learn to recite the Qur'an, many of them in online classes where breathing is invisible to the teacher. Saktah gives a learner the one piece of feedback they cannot get alone, in a way designed around them: the text is large and verbatim, there are no numbers about their body, the only words on screen are about the recitation, and it works hands-free so they can keep their eyes on the ayah.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Most Creative or Delightful Use.&lt;/strong&gt; Contactless vitals are usually pointed at stress, fitness or focus. Here the same signals coach a centuries-old oral tradition, and the rule they check (breathe only at a permitted stop) comes straight from the marks printed in every mushaf.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consent and Data Handling
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Camera consent&lt;/strong&gt; is the first screen, in plain words, before anything starts. Electron grants only the camera (never the microphone), only to the app's own local page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Processing&lt;/strong&gt; happens on the user's computer inside the SmartSpectra SDK. Per Presage's docs, all metric computation runs on-device and the backend is contacted only to check the API key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDK telemetry&lt;/strong&gt; is off (&lt;code&gt;enableTelemetry: false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage, retention, deletion&lt;/strong&gt;: nothing is stored. No video, images or readings are written to disk; results live in memory and disappear when the window closes. There is nothing to delete. (A developer mode, off unless started with an environment variable, saves breathing-trace numbers locally for tuning. It never saves images, and the user-facing app never turns it on.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sharing&lt;/strong&gt;: none. No server, no account, no analytics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI services&lt;/strong&gt;: none. SmartSpectra's optional LLM Insights are not used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not medical.&lt;/strong&gt; Saktah shows no heart rate or breathing rate and makes no health claims. It is a recitation aid.&lt;/li&gt;
&lt;li&gt;The Stop camera button releases the camera immediately.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Qur'an text is the Tanzil Project Uthmani text (CC BY 3.0), shown verbatim; a test checks that every phrase joins back into its exact original ayah for all 6,236 ayat.&lt;/p&gt;

</description>
      <category>presagechallenge</category>
      <category>devchallenge</category>
    </item>
  </channel>
</rss>
