<?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: Johnny Nguyen</title>
    <description>The latest articles on DEV Community by Johnny Nguyen (@johnny_nguyen).</description>
    <link>https://dev.to/johnny_nguyen</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%2F4242073%2F796acc71-4e6f-4afc-af64-e301e5b295ce.png</url>
      <title>DEV Community: Johnny Nguyen</title>
      <link>https://dev.to/johnny_nguyen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/johnny_nguyen"/>
    <language>en</language>
    <item>
      <title>Building a calm iPhone app: a pressure widget that admits when its forecast is old</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Fri, 04 Dec 2026 13:04:45 +0000</pubDate>
      <link>https://dev.to/johnny_nguyen/building-a-calm-iphone-app-a-pressure-widget-that-admits-when-its-forecast-is-old-4k2i</link>
      <guid>https://dev.to/johnny_nguyen/building-a-calm-iphone-app-a-pressure-widget-that-admits-when-its-forecast-is-old-4k2i</guid>
      <description>&lt;p&gt;I work on Pressure Memo at W Lab. It is an iPhone app that shows when the air pressure is likely to drop where you are, sends an alert before big drops, and logs a headache in one tap with the pressure at that minute. People open an app like this on a day they already feel bad, so before any screen was drawn we wrote one rule at the top of the plan: the app has to be calm. This post is about what that rule turned into in code and copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "calm" meant, as rules
&lt;/h2&gt;

&lt;p&gt;A vague value is hard to build against, so it became a list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No sound and no video of its own.&lt;/strong&gt; Nothing autoplays, nothing jingles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No pop-ups between screens.&lt;/strong&gt; You go from Home to your logs and back without anything in the way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Motion follows the system.&lt;/strong&gt; With Reduce Motion on, the confirmation toasts fade instead of sliding, and the time picker in the log sheet opens without animation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nothing is picked for you.&lt;/strong&gt; The log sheet opens with no symptom preselected, so a log says only what the person chose.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most of that is deciding what not to build. The two parts that took real work were the widget and the alerts.&lt;/p&gt;

&lt;h2&gt;
  
  
  A widget that never shows an old number as current
&lt;/h2&gt;

&lt;p&gt;The widget is the screen people see most: the pressure now, its level, and the next likely drop. A WidgetKit timeline is a list of entries the system shows at set times, so the obvious build is "fetch once, show it". The trap is that iOS can keep showing the last entry for a long time after the data behind it has gone stale. A pressure reading from yesterday afternoon, shown as "now", is worse than no reading.&lt;/p&gt;

&lt;p&gt;So the timeline is built from the cached hourly forecast, one entry at the start of each hour, each one showing the pressure for its own hour, worked out the same way Home works out the current minute. Entries that would sit a day or more after the forecast was fetched are dropped, and the timeline ends with a stale entry at exactly that point. The rule, sketched:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="c1"&gt;// One entry per hour, read for that hour; never past fetchedAt + 24 h.&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fetchedAt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addingTimeInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;entries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;hours&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;hour&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;hour&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;hour&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nc"&gt;Entry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hour&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;forecast&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reading&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hour&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;entries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Entry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reading&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// "Can't update the forecast"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The stale entry says "Can't update the forecast" in plain words. It is not an error screen; it is the honest state of the data.&lt;/p&gt;

&lt;p&gt;Two more details keep the widget current without the app being opened. The widget fetches Apple Weather's forecast itself, at most every three hours, through the same store the app reads, and after a good fetch the app reloads the widget timeline. The medium widget also has a Log button, so a headache can be logged from the Home Screen without opening the app at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alerts with no server
&lt;/h2&gt;

&lt;p&gt;Pressure Memo has no backend. Alerts are local notifications, scheduled on the iPhone from the last forecast it received. Each reschedule clears the pending alerts and plans them again for every saved place. It runs after each good fetch, every time the app opens and after any settings change.&lt;/p&gt;

&lt;p&gt;That design has a cost I chose to state in the app's help rather than hide: if the phone hasn't updated for a while, an alert can come from a forecast up to about a day old. Big drops usually show up in the forecast a day or two ahead, so this rarely matters, and opening the app updates everything.&lt;/p&gt;

&lt;p&gt;The calm rule shaped the alerts too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quiet hours, 23:00 to 7:00.&lt;/strong&gt; An alert due in that window waits until 7:00 if the drop is still ahead; otherwise it isn't sent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;At most one alert per drop.&lt;/strong&gt; iOS only reports notifications still in Notification Center, so the scheduler keeps its own record of what it handed over. Clearing an alert never brings it back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ordinary notifications only.&lt;/strong&gt; They are never marked time-sensitive or critical, so a Focus holds them back like anything else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mute for Today&lt;/strong&gt;, right on the alert, silences alerts until midnight.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Words are part of the build
&lt;/h2&gt;

&lt;p&gt;A pressure app is one careless sentence away from a medical claim. Every string follows the same rule: the forecast is about pressure, never about how someone will feel. The app says the pressure is "likely to drop", and when no big drop is ahead, that is worded as likely too, never as certain. Symptoms only ever appear as the person's own logs.&lt;/p&gt;

&lt;p&gt;The same goes for the Pattern screen, which counts how many of your logs came after a pressure fall. It always shows that share next to the share of all hours in the same period, and it says it is a summary of your logs, not a diagnosis. A bare "73% of your headaches" would read as a finding. Next to "all hours: 48%", it reads as what it is: a count.&lt;/p&gt;

&lt;h2&gt;
  
  
  Logging that never waits for the network
&lt;/h2&gt;

&lt;p&gt;A log is saved the moment you tap, online or not. If there is no forecast for that minute yet, the log is marked "Pressure pending" and stamped with the pressure at the next forecast update. The confirmation never shows a placeholder like "— hPa"; it says the pressure will be added.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell someone building something similar
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Write the calm rules down as a list before the first screen. "No sound" is easy to keep; "calm" is not.&lt;/li&gt;
&lt;li&gt;Treat a widget's stale state as a real state with its own words, and decide when it starts.&lt;/li&gt;
&lt;li&gt;If alerts run without a server, say plainly what that costs.&lt;/li&gt;
&lt;li&gt;Review copy as strictly as code. In health-adjacent apps, the words are where the risk is.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pressure Memo is free on the App Store as "Pressure Memo – Headache Log", for iPhone with iOS 17 or later: &lt;a href="https://w-lab.app/apps/kiatsu/" rel="noopener noreferrer"&gt;https://w-lab.app/apps/kiatsu/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>widgetkit</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Running a small company of coding agents on my own machine</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Fri, 27 Nov 2026 08:26:21 +0000</pubDate>
      <link>https://dev.to/johnny_nguyen/running-a-small-company-of-coding-agents-on-my-own-machine-1gb4</link>
      <guid>https://dev.to/johnny_nguyen/running-a-small-company-of-coding-agents-on-my-own-machine-1gb4</guid>
      <description>&lt;p&gt;I work on Sam at W Lab. Sam is a desktop app (macOS, Windows, Linux, plus a local web version) that acts as a chief of staff for AI agents: you talk to Sam, and it hands the work to "departments" of agents running on the engine you already use, Claude Code, Codex, Gemini CLI, DeepSeek or Grok.&lt;/p&gt;

&lt;p&gt;This post is about why we ended up modelling agents as a company, and what that changes day to day.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with a pile of sessions
&lt;/h2&gt;

&lt;p&gt;Once you run more than a few agent sessions, the hard part stops being prompting. It's keeping track: which session was refactoring the backend, which one was drafting the course outline, which account it ran under, and which one is waiting for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Departments
&lt;/h2&gt;

&lt;p&gt;In Sam each department has a head (the agent in charge), its own workspace, its own skills and its own account. You decide the structure: who reports to whom, who works with whom. A "Engineering" department and a "Marketing" department can run on different engines and accounts without stepping on each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  One chat, routed
&lt;/h2&gt;

&lt;p&gt;You don't pick the department yourself. You tell Sam what you need in one chat; Sam asks back when details are missing, splits the work to the right departments, and closes the session when it's done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tasks you can actually follow
&lt;/h2&gt;

&lt;p&gt;Tasks run on a kanban board. You can watch an agent's log live, and approve or ask for changes right in the task's detail panel. At the end of the day, each department head reports to Sam and Sam sends you one summary; an OS notification arrives when something needs your approval, fails, or Sam has a question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local first
&lt;/h2&gt;

&lt;p&gt;The data lives in SQLite on your machine and doesn't go through any Sam server. The local version is free to use.&lt;/p&gt;

&lt;p&gt;Sam's site, with downloads for all three systems: &lt;a href="https://sam.w-lab.app/" rel="noopener noreferrer"&gt;https://sam.w-lab.app/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>The checks I run before every App Store and Google Play release</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Fri, 27 Nov 2026 08:25:20 +0000</pubDate>
      <link>https://dev.to/johnny_nguyen/the-checks-i-run-before-every-app-store-and-google-play-release-1ngj</link>
      <guid>https://dev.to/johnny_nguyen/the-checks-i-run-before-every-app-store-and-google-play-release-1ngj</guid>
      <description>&lt;p&gt;I work on AppShip Studio at W Lab. It's a desktop app (Mac, Windows, and a web version) that takes an iOS or Android project to both stores without the terminal, and this post is about the part I'd want even without it: the checks before you press submit.&lt;/p&gt;

&lt;p&gt;Most rejected or delayed releases I've seen weren't about code. They were a description over the limit, a screenshot at the wrong size, an unanswered privacy question, or sample text nobody replaced. All of it is checkable before the store ever sees it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The list
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Character limits, per store and per language.&lt;/strong&gt; The App Store and Google Play count differently and cap different fields: app name, subtitle or short description, keywords, full description, "What's new". A translation that fits in English can run over in German.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Image sizes.&lt;/strong&gt; Each store accepts specific screenshot sizes and rejects images with transparency. iPhone 6.9-inch screenshots are 1320 × 2868; Google Play also wants a 1024 × 500 feature graphic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Missing answers.&lt;/strong&gt; Age rating, Apple's App Privacy, Google Play's Data safety, and the contact Apple's reviewer can reach. Each store blocks submission until these are done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Leftover placeholders.&lt;/strong&gt; Template text in the description, a support URL still pointing at example.com, a privacy policy link that was never filled in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keys.&lt;/strong&gt; The App Store Connect API key and the Google Play service account must be the ones for this app's account, and still valid.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making it one button
&lt;/h2&gt;

&lt;p&gt;In AppShip Studio these are a single "Check my app" button: the same checks as &lt;code&gt;appship doctor&lt;/code&gt; in the open-source appship-ai CLI it's built on. Each problem is shown in plain words on the step where you fix it, with a red dot until it's done. Nothing goes to a store until you confirm.&lt;/p&gt;

&lt;p&gt;Whether you use it or a checklist in your README, run the list before every release. It's the cheapest review you'll ever get.&lt;/p&gt;

&lt;p&gt;More about AppShip Studio, and a walk-through of all six steps: &lt;a href="https://w-lab.app/apps/appship-studio/" rel="noopener noreferrer"&gt;https://w-lab.app/apps/appship-studio/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>android</category>
      <category>flutter</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Wireless ADB pairing from one Android phone to another (Android 11+, no root)</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Thu, 26 Nov 2026 17:04:48 +0000</pubDate>
      <link>https://dev.to/johnny_nguyen/wireless-adb-pairing-from-one-android-phone-to-another-android-11-no-root-4dh6</link>
      <guid>https://dev.to/johnny_nguyen/wireless-adb-pairing-from-one-android-phone-to-another-android-11-no-root-4dh6</guid>
      <description>&lt;p&gt;S-ADB is made by W Lab × PixelAI Lab, and I work on it at W Lab. This is a walk-through of the part developers ask about most: pairing two Android devices over Wireless ADB, phone to phone, without a cable or a computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Two Android devices on the same local network.&lt;/li&gt;
&lt;li&gt;Android 11 or newer on the device you pair with: that is the version that added Wireless debugging to Developer options.&lt;/li&gt;
&lt;li&gt;No root. Pairing works without it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pairing, step by step
&lt;/h2&gt;

&lt;p&gt;S-ADB runs the pairing as a guided flow with a progress tracker ("Step 3 of 4"), so you always know which device needs your attention next.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;On the device you want to reach&lt;/strong&gt;, open Developer options → Wireless debugging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick a pairing method.&lt;/strong&gt; Either choose &lt;em&gt;Pair device with QR code&lt;/em&gt; and scan the QR code S-ADB shows, and pairing starts automatically; or choose &lt;em&gt;Pair device with pairing code&lt;/em&gt;, keep that dialog open, find the device in S-ADB's list of nearby devices on your network, and type its 6-digit code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Done.&lt;/strong&gt; The paired device is remembered, and S-ADB reconnects to it even when the Wireless debugging port changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What you can do once connected
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A terminal-style shell with colored output, quick commands, copy, and a Stop button for long commands.&lt;/li&gt;
&lt;li&gt;A device info card: model, Android version, battery, storage and network.&lt;/li&gt;
&lt;li&gt;Live logcat with filters and saved filter presets.&lt;/li&gt;
&lt;li&gt;An app manager: search, open, force stop, clear data, uninstall, or install an APK.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The guard rails
&lt;/h2&gt;

&lt;p&gt;Remote control is off by default. The controlled device has to opt in and approve each connection on Android's own ADB prompt. A view-only mode blocks touch input and commands that change the device, and destructive commands show a warning before they run. It works on your local network; for devices on different networks, the listing suggests a VPN mesh such as Tailscale.&lt;/p&gt;

&lt;p&gt;S-ADB is free to download on Google Play as "S-ADB: Wireless Debug": &lt;a href="https://w-lab.app/apps/s-adb/" rel="noopener noreferrer"&gt;https://w-lab.app/apps/s-adb/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>showdev</category>
      <category>tools</category>
    </item>
    <item>
      <title>Your photo already knows its settings: turning EXIF into a caption frame</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Thu, 26 Nov 2026 16:58:10 +0000</pubDate>
      <link>https://dev.to/johnny_nguyen/your-photo-already-knows-its-settings-turning-exif-into-a-caption-frame-8j8</link>
      <guid>https://dev.to/johnny_nguyen/your-photo-already-knows-its-settings-turning-exif-into-a-caption-frame-8j8</guid>
      <description>&lt;p&gt;ShotStamp is made by W Lab × Ketch Studio, and I work on it at W Lab. This post is about the data it reads, and why a frame built from that data beats typing the caption yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The settings are already in the file
&lt;/h2&gt;

&lt;p&gt;When a camera or phone saves a JPEG, it writes EXIF metadata into the same file: the camera model, the lens, the aperture, the shutter speed, the ISO, the focal length, the date and time, and often the GPS position. Photographers share those numbers all the time ("105mm, f/3.5, 1/15s, ISO 400") because they explain how a shot was made. Typing them out by hand is slow, and it is easy to copy one wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading it instead of typing it
&lt;/h2&gt;

&lt;p&gt;ShotStamp reads the EXIF from mirrorless, DSLR and phone photos. Pick a photo and the camera, lens, aperture, shutter speed, ISO, focal length, date and location fill in on their own, with no typing. From there it is layout work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pick a template:&lt;/strong&gt; a minimal info bar, an instant or film-strip frame, a gallery mat or an editorial layout.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decide what shows.&lt;/strong&gt; Every field can be shown, hidden or edited, and the text can be dragged where you want it. A field that reads wrong can be corrected by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add a look:&lt;/strong&gt; 11 color filters and a choice of frame colors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep the data after the frame
&lt;/h2&gt;

&lt;p&gt;A frame is a new image, so it matters what happens to the metadata on export. ShotStamp saves full-resolution JPEGs that keep the EXIF data, at the original size or at 4:5, 1:1 or 9:16 for feeds, squares and stories. The numbers are on the picture for people, and still in the file for software.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nothing leaves the phone
&lt;/h2&gt;

&lt;p&gt;Stamping and export happen on the device. The photos are not uploaded, which is what you want for pictures that carry a GPS position.&lt;/p&gt;

&lt;p&gt;ShotStamp is on the App Store and Google Play as "ShotStamp: EXIF Watermark", for iPhone, iPad and Android, free to download: &lt;a href="https://w-lab.app/apps/shotstamp/" rel="noopener noreferrer"&gt;https://w-lab.app/apps/shotstamp/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>photography</category>
      <category>showdev</category>
      <category>tools</category>
    </item>
    <item>
      <title>Why I took Whisper out of my iPhone transcription app before it shipped</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Tue, 17 Nov 2026 09:57:46 +0000</pubDate>
      <link>https://dev.to/johnny_nguyen/why-i-took-whisper-out-of-my-iphone-transcription-app-before-it-shipped-1hi1</link>
      <guid>https://dev.to/johnny_nguyen/why-i-took-whisper-out-of-my-iphone-transcription-app-before-it-shipped-1hi1</guid>
      <description>&lt;p&gt;I work on Koedori at W Lab. It is an iPhone app that records a lecture, a meeting or an interview and turns it into text on the phone itself, with no account, and the audio is never uploaded. The early builds ran Whisper through WhisperKit. The version on the App Store has no Whisper in it at all: it uses Apple's SpeechAnalyzer framework and its SpeechTranscriber module. This post is about why, and what building on SpeechTranscriber is like.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule that picks the engine
&lt;/h2&gt;

&lt;p&gt;Koedori makes three promises: transcription is free and needs no account, audio never leaves the phone, and re-transcribing costs nothing, as often as you like. The second one is architecture, not a setting. There is no code path that uploads audio, and the app has no server of its own. So recognition has to run on the device, and it has to be cheap enough to run again on a whim.&lt;/p&gt;

&lt;p&gt;Whisper on the phone met that on paper. The trouble was everything around the model.&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong with Whisper on real phones
&lt;/h2&gt;

&lt;p&gt;WhisperKit compiles a model for the Neural Engine the first time it loads it. On the iPhone 14 I measured, the first load of large-v3 turbo after an install took 197 to 205 seconds, every time. A reload within the same install took 4 seconds, and a 10-second clip then transcribed in 0.9 seconds. Fast once warm, minutes from cold. Every Xcode run is an install, so development paid that wait on every build, and a pass started mid-compile showed nothing for minutes, which meant a "preparing" step on screen.&lt;/p&gt;

&lt;p&gt;Memory was the next surprise. Without WhisperKit's &lt;code&gt;prewarm&lt;/code&gt;, one run logged that it couldn't reach the compiler's helper, fell back to the CPU and peaked at 799 MB. With &lt;code&gt;prewarm: true&lt;/code&gt; the same load peaked at 193 MB.&lt;/p&gt;

&lt;p&gt;Older hardware was worse. On some older chips the encoder heard nothing when it ran on the CPU, and one test device never finished optimizing Whisper small. And the app had to carry a model: Whisper small, bundled, is about 490 MB, plus code to download the others.&lt;/p&gt;

&lt;p&gt;So the app got one engine everywhere: SpeechTranscriber. That cost two things. SpeechTranscriber is new, so older iOS versions were dropped rather than kept on Whisper. And it has about ten languages (English, Japanese, Chinese, Korean, Spanish, French, German, Italian, Portuguese…) against Whisper's hundred. What left with Whisper: the bundled model, the model picker, our download code and the compile wait. iOS now fetches a language's model itself, once, through &lt;code&gt;AssetInventory&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The file pass
&lt;/h2&gt;

&lt;p&gt;Whatever the mode, a note is made by one pass over the finished recording: a &lt;code&gt;SpeechAnalyzer&lt;/code&gt; with one &lt;code&gt;SpeechTranscriber&lt;/code&gt; module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="nc"&gt;SpeechTranscriber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;transcriptionOptions&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;span class="n"&gt;reportingOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;reportingOptions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;attributeOptions&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;audioTimeRange&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;&lt;code&gt;.audioTimeRange&lt;/code&gt; is the option that matters. A result covers roughly 20 seconds of audio, far too coarse to tap. But every attributed run inside a result carries its own time range (for Japanese, one character), so a line cut from the middle of a result keeps a real start time. That is what lets a tap on any transcript line play the audio from that moment.&lt;/p&gt;

&lt;p&gt;The pass hands the file to the analyzer whole (shortened from the app):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;analyzer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SpeechAnalyzer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;modules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;collected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isFinal&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* keep it, report progress */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;analyzer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;analyzeSequence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;analyzer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;finalizeAndFinish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;through&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;analyzer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cancelAndFinishNow&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;Three details. &lt;code&gt;analyzeSequence(from:)&lt;/code&gt; converts the file itself (our test fixture is 22.05 kHz Float32, the engine wants 16 kHz Int16), so there is no reason to feed buffers by hand. Results are read on their own task while the file is read, or the progress bar jumps from 0 to 1. And when no audio reaches the analyzer you still have to finish it, or &lt;code&gt;module.results&lt;/code&gt; never ends and that task waits forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is the language on this phone?
&lt;/h2&gt;

&lt;p&gt;Before offering to transcribe, the app asks three questions (condensed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="nc"&gt;SpeechTranscriber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isAvailable&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unavailable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;guard&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;SpeechTranscriber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;supportedLocale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;equivalentTo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Locale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;identifier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;localeUnsupported&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;wanted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;identifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bcp47&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;installed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;SpeechTranscriber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;installedLocales&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;contains&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;identifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bcp47&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;wanted&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The obvious API for the last question is &lt;code&gt;AssetInventory.status(forModules:)&lt;/code&gt;, and it misled me. On a Mac with the Japanese model installed and transcribing, it said &lt;code&gt;.supported&lt;/code&gt;, not installed, until the locale had been reserved. Reserving is a side effect, and an app holds only five reserved locales at a time, so a readiness check has no business doing it. &lt;code&gt;installedLocales&lt;/code&gt; answers the real question. Compare in BCP-47 too, rather than trusting &lt;code&gt;ja_JP&lt;/code&gt; and &lt;code&gt;ja-JP&lt;/code&gt; to match.&lt;/p&gt;

&lt;p&gt;If the model is missing when a recording stops, the recording is still saved, marked "Waiting to transcribe", and retried whenever the app comes to the front.&lt;/p&gt;

&lt;h2&gt;
  
  
  Live text is shown, never kept
&lt;/h2&gt;

&lt;p&gt;On the New recording screen, Transcribe is "After stopping" or "While recording". While recording, the audio tap writes the .m4a and also hands each buffer to a second analyzer, through a converter from the microphone's format (typically 48 kHz Float32) into what &lt;code&gt;SpeechAnalyzer.bestAvailableAudioFormat&lt;/code&gt; asks for. One converter lives as long as the input format holds, so the resampler's state carries across buffers and nothing drifts at the seams. The tap is a realtime thread with a file to write, so it only copies each buffer into a queue. The engine takes a moment to load, and audio from that moment is held, not dropped.&lt;/p&gt;

&lt;p&gt;Two measurements, made on a Mac with the same framework, shaped this mode. With &lt;code&gt;.volatileResults&lt;/code&gt; alone, the first words showed 11.7 seconds after they were spoken. Adding &lt;code&gt;.fastResults&lt;/code&gt; brought that under a second. But the streamed text was never the file pass's text, even from an identically configured module: over the same 10 minutes, about 1.5 places a minute (around 0.7% of characters) came out differently, at the same places every run, neither side more accurate.&lt;/p&gt;

&lt;p&gt;So the live box is a display. The note always comes from the file pass after Stop, in every mode, and the file pass never uses &lt;code&gt;.fastResults&lt;/code&gt;, which trades accuracy for speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Corrections are a text layer
&lt;/h2&gt;

&lt;p&gt;Speech recognition gets names wrong: a lecturer's surname, a course term, a colleague. Koedori's Dictionary takes "heard as X, should be Y".&lt;/p&gt;

&lt;p&gt;Each note stores the engine's text exactly as the engine wrote it, plus a snapshot of the dictionary it was read with. Corrections apply when the note is shown, searched or exported. A new correction makes the snapshot stale, and the difference is the note's count of pending fixes. Fixing them does no recognition at all: it stamps the current snapshot. That is why rewriting earlier notes with a new correction is instant, why new transcripts get the same fix, and why a note whose audio was deleted can still be fixed.&lt;/p&gt;

&lt;p&gt;The API offers a second route, &lt;code&gt;AnalysisContext.contextualStrings&lt;/code&gt;, and the app passes the dictionary's words there before any audio. I haven't seen it do anything. In a test on a Mac I registered 限界効用 ("marginal utility") and the engine still wrote 限界公用, in the transcript and in its alternatives. It isn't measured on a phone, so the app promises the text layer, not the hint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turning results into lines
&lt;/h2&gt;

&lt;p&gt;The engine's own boundaries over-segment, which left a line like "confidence." alone under the sentence it finishes. Phrases under 1.5 seconds apart are merged first, then lines are capped at 200 characters, or 70 for Japanese, Chinese and Korean. That is longer than a subtitle cue on purpose: tapping a line to hear it again is what this screen is for.&lt;/p&gt;

&lt;p&gt;Japanese has one more catch: the recognizer emits no 。, so sentences can't be found by punctuation. Where the app needs them, for a note's title, it also cuts after a polite ending (ます, です, ください) unless the next words continue the clause (…ますが, …ますので).&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing an engine the simulator doesn't have
&lt;/h2&gt;

&lt;p&gt;The simulator has the Speech framework but no engine: &lt;code&gt;isAvailable&lt;/code&gt; is false and the language list is empty. Engine tests are gated with &lt;code&gt;.enabled(if:)&lt;/code&gt; on a file-scope constant, and the real check runs on a Mac: a script compiles the production files and transcribes a fixture under &lt;code&gt;sandbox-exec&lt;/code&gt; with the network denied. "Works offline" is a test, not a line in the listing.&lt;/p&gt;

&lt;p&gt;The fixture is synthesized speech. It proves the pipeline runs and says nothing about accuracy, so I don't quote numbers from it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it doesn't do
&lt;/h2&gt;

&lt;p&gt;Speaker labels aren't available on the device, so a transcript is lines with times, not names. It doesn't write summaries. It records with the screen locked (a recording over three hours is saved in parts, so nothing is lost), transcribes on the phone, and lets you search, fix and export as plain text, Markdown, SRT or WebVTT.&lt;/p&gt;

&lt;p&gt;Koedori is on the App Store for iPhone as “Lecture Recorder: Transcribe”: &lt;a href="https://w-lab.app/apps/koedori/" rel="noopener noreferrer"&gt;https://w-lab.app/apps/koedori/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>machinelearning</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Why red ink vanishes under a red sheet, and how I made an iPhone do it</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Sat, 14 Nov 2026 08:07:32 +0000</pubDate>
      <link>https://dev.to/wlab/why-red-ink-vanishes-under-a-red-sheet-and-how-i-made-an-iphone-do-it-2haa</link>
      <guid>https://dev.to/wlab/why-red-ink-vanishes-under-a-red-sheet-and-how-i-made-an-iphone-do-it-2haa</guid>
      <description>&lt;p&gt;I work on Red Sheet at W Lab. Students in Japan write answers in red or orange pen, lay a sheet of red plastic over the page, and the answers disappear while the black questions stay. Slide the sheet down and you check yourself one line at a time. Red Sheet is an iPhone and iPad app that does this to a photo of your own notebook. This post is about the engine that finds the ink and hides it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the paper trick works, and why a filter isn't enough
&lt;/h2&gt;

&lt;p&gt;Red plastic passes red light and blocks the rest. Through it, white paper looks red and red ink looks red, so the ink has nothing to stand out against. Black ink reflects no red either way, so it stays dark. Green highlighter is the opposite case: it reflects almost no red, so through the sheet it turns nearly black and blocks the word under it.&lt;/p&gt;

&lt;p&gt;The obvious way to copy that on a phone is to take the photo's red channel and tint it. I kept that version in the code as a comparison, and it fails on real photos. A phone photo of a notebook has a shadow across it, warm indoor light, greyish recycled paper. Red ink on a shadowed page is not the same value as the paper next to it, so it shows through as a faint ghost. A plastic sheet gets away with this because your eye adapts. An image doesn't.&lt;/p&gt;

&lt;p&gt;So the app does not filter. It works out which pixels are answer ink, and guarantees those are gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: make the paper white
&lt;/h2&gt;

&lt;p&gt;Before any colour decision, the lighting has to come out. The engine estimates the paper level at every point of the page: a morphological closing (a max filter, then a min filter) at quarter scale wipes out the writing and leaves the paper, and a box blur smooths it. Dividing each colour channel by that map sends paper to white under any light, and because the three channels are divided separately, yellowish paper comes out white too.&lt;/p&gt;

&lt;p&gt;Pictures in a textbook would wreck that estimate, so coloured figures are found first, as blocks of cells that are saturated and span several hues, and filled in from their borders. Dark photos and panels count as figures too. That rule came from a bug: flattening turned a near-black panel into something that looked like marker.&lt;/p&gt;

&lt;p&gt;A PDF page skips this step. It has no shadow to undo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: decide what is ink, in Lab
&lt;/h2&gt;

&lt;p&gt;Colour decisions are made in CIELAB, where distances roughly match what people see. Converting every pixel is slow, so the conversion is a lookup table with 64 levels per channel, built once.&lt;/p&gt;

&lt;p&gt;A pixel is ink if it is far enough from white. Ink with little chroma is black if it is dark, and paper if it is light, which is how the grey anti-aliased edge of a black letter is kept out. The rest is coloured ink.&lt;/p&gt;

&lt;p&gt;Fixed hue thresholds don't survive real pens, so the coloured pixels of each page are clustered with k-means, six clusters with a fixed seed so the result is repeatable. The page tells the engine what its own red looks like. Pale pixels on the rim of a stroke take the label of the saturated pixel beside them, so an orange stroke's faint edge belongs to the stroke and not to some pale marker of a similar hue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: pen or highlighter is a question of shape
&lt;/h2&gt;

&lt;p&gt;Hue alone can't separate a pink pen from a pink highlighter. Shape can. A highlighter is a solid band: its bounding box, counting the black text inside it, is mostly filled and about as thick as a character. A pen stroke is thin and its box is mostly empty.&lt;/p&gt;

&lt;p&gt;That gives the classes the sheets care about. Red, orange and pink pen vanish under the red sheet. Green highlighter goes dark under it and blocks the word. Under the green sheet it is pink highlighter that blocks, and under the blue sheet a blue pen vanishes. A thin green stroke or a wide blue one is neither, and is never hidden.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: from pixels to answers you can tap
&lt;/h2&gt;

&lt;p&gt;Hidden ink is not yet an answer. A handwritten answer is several strokes and often several words, and the app needs one box per answer to reveal on a tap.&lt;/p&gt;

&lt;p&gt;The ink mask is dilated a little more along the writing direction than across it, and the blobs are labelled with a two-pass union-find. Then come the rules that make a box match what a person would call one answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A blob taller than a line and a half is cut into lines at the valleys of its ink profile.&lt;/li&gt;
&lt;li&gt;Pieces on the same line, close together, with no black ink between them are one answer. The "no black ink between" part stops two answers in neighbouring table cells from merging.&lt;/li&gt;
&lt;li&gt;Specks are dropped. Long thin strokes are underlines: they get hidden, but they are not answers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Writing direction is measured, not assumed, because Japanese notebooks are often vertical. If tall blobs clearly outweigh wide ones, the page is vertical, and the dilation and the sliding band turn with it.&lt;/p&gt;

&lt;p&gt;Each answer gets a key from its ink class and its position on a coarse grid. When detection runs again, answers are matched by key, so anything the user changed by hand stays attached to the right one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: the guarantee
&lt;/h2&gt;

&lt;p&gt;Rendering is where "mostly hidden" becomes "hidden". For ink that should vanish, the mask is dilated by two pixels at full strength and one more at half strength, and those pixels are replaced with an estimate of the paper under them: the mean colour of nearby non-ink pixels, with the paper's own grain added back so the patch doesn't look painted. Only then is the sheet's tint applied. Black text and figures are never touched.&lt;/p&gt;

&lt;p&gt;The sheet is computed once per page as a whole image. Moving the band only changes a clip rectangle, so dragging stays smooth. Revealing an answer draws the original photo's pixels back inside its box. Until the first render is ready, the page shows blurred under the sheet colour, so an answer is never on screen before it is hidden.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping it fast and testable
&lt;/h2&gt;

&lt;p&gt;The engine is a pure Swift package with plain loops over a pixel buffer, on a working copy whose long edge is 1200 pixels. The min and max filters are the van Herk / Gil-Werman kind, constant time per pixel whatever the radius. Analysis runs off the main thread, a few pages at a time, since each one holds tens of megabytes of per-pixel planes.&lt;/p&gt;

&lt;p&gt;I wrote the engine first as a JavaScript mockup in a browser, where tuning a threshold and seeing the result takes a second, then ported it to Swift function by function. The Swift tests run twenty fixture pages, four kinds of page under five lighting conditions including shadow, warm light and recycled paper, and must match the mockup's output and find the same number of answers.&lt;/p&gt;

&lt;p&gt;All of this runs on the device. The app's own code makes no network requests, and the camera permission text says what is true: images are never sent to us.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it still gets wrong
&lt;/h2&gt;

&lt;p&gt;A heading printed in red is hidden just like red pen. A real red sheet hides it too, so I left that alone and gave the user an eraser: tap a wrong hit and it shows for good, even after the page is detected again. For the opposite case, a word printed in black, the user drags a box or runs a marker over it and it hides under every sheet.&lt;/p&gt;

&lt;p&gt;Red Sheet is on the App Store for iPhone and iPad as "Red Sheet - Photo &amp;amp; PDF Study": &lt;a href="https://w-lab.app/apps/redsheet/" rel="noopener noreferrer"&gt;https://w-lab.app/apps/redsheet/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>imageprocessing</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Building an offline audio editor in Flutter: what the platforms won't encode for you</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Sat, 14 Nov 2026 07:58:06 +0000</pubDate>
      <link>https://dev.to/wlab/building-an-offline-audio-editor-in-flutter-what-the-platforms-wont-encode-for-you-30fc</link>
      <guid>https://dev.to/wlab/building-an-offline-audio-editor-in-flutter-what-the-platforms-wont-encode-for-you-30fc</guid>
      <description>&lt;p&gt;I work on AuCut at W Lab. It is an audio editor for iPhone and Android: trim a recording, pull the audio out of a video, convert between MP3, M4A and WAV, change the volume or the speed. Everything is processed on the phone and no file is uploaded. That one rule shaped most of the architecture, and this post is about where it got awkward.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Flutter UI, two native engines, and FFmpeg
&lt;/h2&gt;

&lt;p&gt;The UI is Flutter with Riverpod: one controller and one screen per tool under &lt;code&gt;lib/features&lt;/code&gt;, shared services under &lt;code&gt;lib/core&lt;/code&gt;. Dart doesn't touch audio samples. It talks to native code over one &lt;code&gt;MethodChannel&lt;/code&gt; for commands (trim, extract, convert, get duration, cancel) and one &lt;code&gt;EventChannel&lt;/code&gt; for progress.&lt;/p&gt;

&lt;p&gt;Behind that channel are two different engines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On iOS, AVFoundation, mostly &lt;code&gt;AVAssetExportSession&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;On Android, Media3 &lt;code&gt;Transformer&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And beside both, FFmpeg, through the LGPL audio-only build of FFmpegKit. The platform APIs alone turned out not to be enough, for the reasons below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Neither platform will write an MP3
&lt;/h2&gt;

&lt;p&gt;Both phones play MP3 all day. Neither ships an MP3 encoder you can call. AVFoundation has none, and neither does Android's stock codec set. So "save as MP3" is a two-step job: the native side exports M4A, then FFmpeg re-encodes it with libmp3lame. The progress bar is weighted so the two halves look like one job.&lt;/p&gt;

&lt;p&gt;WAV is the opposite surprise. It is the simplest format there is, and neither export API will produce it. &lt;code&gt;AVAssetExportSession&lt;/code&gt; has no WAV preset, and &lt;code&gt;Transformer&lt;/code&gt; can't write one. Both are done by hand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;iOS: read with &lt;code&gt;AVAudioFile&lt;/code&gt;, convert with &lt;code&gt;AVAudioConverter&lt;/code&gt;, write 16-bit PCM.&lt;/li&gt;
&lt;li&gt;Android: decode to raw PCM with &lt;code&gt;MediaExtractor&lt;/code&gt; and &lt;code&gt;MediaCodec&lt;/code&gt;, then put a 44-byte WAV header in front of it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rule I ended up with: the platform does what it does well (cutting, pulling a track out of a video, AAC), and FFmpeg does what the platform can't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trimming without re-encoding when possible
&lt;/h2&gt;

&lt;p&gt;A trim is a time range on an export. On iOS that is a &lt;code&gt;CMTimeRange&lt;/code&gt; on the export session. The session uses the passthrough preset when the source codec can be copied straight into an M4A container, which is fast and loses nothing, and falls back to an AAC re-encode when it can't. On Android it is a clipping configuration on the media item.&lt;/p&gt;

&lt;p&gt;If the user also asked for MP3 output, a volume change or a fade, a second FFmpeg pass follows the native cut.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cutting by ear, to a tenth of a second
&lt;/h2&gt;

&lt;p&gt;A waveform is too coarse to cut speech by eye. You can't see where a word ends. So the editor is built around listening:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dragging a handle on the waveform is continuous.&lt;/li&gt;
&lt;li&gt;Two arrow buttons under each handle move it 0.1 s per tap. Hold one and it repeats, then speeds up to 1 s steps.&lt;/li&gt;
&lt;li&gt;A jog bar under each handle gives fine control over ±5 seconds from where you touch it.&lt;/li&gt;
&lt;li&gt;Every time a cut point moves, the app plays two seconds around it: the first two seconds of what will be kept after a start point, the last two before an end point. You hear exactly what the cut will sound like.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The waveform is 100 bars of RMS, extracted natively by the audio_waveforms plugin. I paint the bars myself with a &lt;code&gt;CustomPainter&lt;/code&gt; behind a &lt;code&gt;RepaintBoundary&lt;/code&gt;, because the plugin's own widget repainted every bar on each drag frame. Seeks while scrubbing are throttled to one per 60 ms. A seek is async, and queueing one per pointer event just piles them up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Speed without pitch, pitch without speed
&lt;/h2&gt;

&lt;p&gt;Both are FFmpeg filters. &lt;code&gt;atempo&lt;/code&gt; changes tempo and keeps pitch. &lt;code&gt;asetrate&lt;/code&gt; changes both together. So a pitch shift is &lt;code&gt;asetrate&lt;/code&gt; by the pitch ratio, then an &lt;code&gt;atempo&lt;/code&gt; that cancels the tempo change it caused:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="s1"&gt;'aresample=$rate'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'asetrate=${(rate * k).round()}'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'aresample=$rate'&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;span class="nf"&gt;_atempoChain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;speed&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;// k = 2^(semitones / 12)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Older FFmpeg builds only accept 0.5 to 2.0 per &lt;code&gt;atempo&lt;/code&gt; instance, so larger changes are chained.&lt;/p&gt;

&lt;p&gt;Normalising volume uses FFmpeg's &lt;code&gt;loudnorm&lt;/code&gt;, which measures loudness the EBU R128 way, not by peak. One trap: &lt;code&gt;loudnorm&lt;/code&gt; upsamples to 192 kHz internally, so the filter chain has to resample back down or the output file balloons.&lt;/p&gt;

&lt;h2&gt;
  
  
  Files that arrive from other apps
&lt;/h2&gt;

&lt;p&gt;Much of the real use starts in another app: a voice memo, a video in Photos, an audio message from a chat. On iOS the app declares itself a viewer for audio and movie types. On Android it has intent filters for send and view. Either way the native side copies the file into a temp directory, queues its path, and Dart drains the queue and asks which tool to open it in.&lt;/p&gt;

&lt;p&gt;Two details mattered there. On a cold launch, the file can arrive before Flutter is listening, so the Dart side drains the queue once at start-up and the iOS side sweeps its inbox when asked. And chat apps hand over OPUS, OGG and FLAC, which the native trim path won't take, so anything that isn't M4A, MP3 or WAV is re-encoded to M4A by FFmpeg on the way in.&lt;/p&gt;

&lt;p&gt;Temp files carry a timestamp in their name and are cleaned up after 24 hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Small things that cost real time
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reading a file's duration does file I/O and can stall on a large or cold file, so it runs off the main thread on both platforms. An unreadable asset reports a NaN duration, and converting that to an &lt;code&gt;Int&lt;/code&gt; in Swift traps.&lt;/li&gt;
&lt;li&gt;Android's &lt;code&gt;EventSink&lt;/code&gt; may only be called on the UI thread. A decode loop on a background thread has to post its progress.&lt;/li&gt;
&lt;li&gt;A stray back swipe used to throw away a long export without a word. Now a guard asks first, and leaving a tool cancels its job. Riverpod providers outlive their screen, so without that a job kept running where nobody could see it.&lt;/li&gt;
&lt;li&gt;The strings are in eight languages, and a test fails if any language is missing a key or has an extra one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I'd do the same way again
&lt;/h2&gt;

&lt;p&gt;Keep one narrow channel between Dart and native, with every operation reporting progress and accepting a cancel. Let each platform's own exporter do the cutting. And accept early that an audio app needs FFmpeg for the formats and filters the platforms leave out.&lt;/p&gt;

&lt;p&gt;AuCut is on the App Store as "AuCut: Audio Cutter &amp;amp; Editor" and on Google Play as "adTrim: Offline Audio Tools": &lt;a href="https://w-lab.app/apps/aucut/" rel="noopener noreferrer"&gt;https://w-lab.app/apps/aucut/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>audio</category>
      <category>showdev</category>
    </item>
    <item>
      <title>What it takes to turn an iPhone microphone into a decibel meter</title>
      <dc:creator>Johnny Nguyen</dc:creator>
      <pubDate>Fri, 13 Nov 2026 03:41:17 +0000</pubDate>
      <link>https://dev.to/wlab/what-it-takes-to-turn-an-iphone-microphone-into-a-decibel-meter-1j4p</link>
      <guid>https://dev.to/wlab/what-it-takes-to-turn-an-iphone-microphone-into-a-decibel-meter-1j4p</guid>
      <description>&lt;p&gt;I work on Noise Meter at W Lab. It is an iPhone app that shows the sound level in decibels and logs a whole night of it, so someone with a noisy neighbour can show when it was loud. This post is about the measuring part: what happens between the microphone and the number on screen, and the places where I had to be honest about what a phone can't do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting clean samples
&lt;/h2&gt;

&lt;p&gt;iOS processes microphone input by default: automatic gain, noise suppression, EQ. All of that is exactly what a meter must not have, because a quiet room would be boosted and a loud one pulled down. The audio session mode that turns it off is &lt;code&gt;.measurement&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setCategory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;record&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;measurement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setPreferredSampleRate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;48_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From there it is an &lt;code&gt;AVAudioEngine&lt;/code&gt; input tap with a 4800-frame buffer, which is 100 ms at 48 kHz. I ask for 48 kHz but build the analyzer for whatever rate the hardware returns. I also select the built-in microphone's bottom data source with an omnidirectional pattern, and re-select it on every route change, because a route change can move the input.&lt;/p&gt;

&lt;p&gt;One Swift 6 trap is worth knowing about. A closure created inside a &lt;code&gt;@MainActor&lt;/code&gt; method inherits that isolation, and the audio thread calling it is a runtime trap. The tap block has to be built in a nonisolated context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Weighting: A, C and Z
&lt;/h2&gt;

&lt;p&gt;A raw level over-reports low rumble compared with what people hear, so sound level meters apply a frequency weighting. A-weighting follows the ear, C-weighting keeps much more bass, and Z is flat.&lt;/p&gt;

&lt;p&gt;The standard, IEC 61672-1, defines these curves by their analog poles (20.6 Hz, 107.7 Hz, 737.9 Hz and 12194 Hz). I bilinear-transform those poles at runtime for the actual sample rate into up to three biquad sections, and normalise the gain to 0 dB at 1 kHz. A-weighting is a high-pass, a middle section and a low-pass; C drops the middle section; Z is a passthrough. The filter runs per sample in plain Swift &lt;code&gt;Double&lt;/code&gt;s, with no FFT.&lt;/p&gt;

&lt;p&gt;The bilinear transform warps the top of the spectrum, so I wrote down how far off it is: at 48 kHz it stays inside the standard's class 2 tolerance from 31.5 Hz to 8 kHz, and is 2.6 dB low at 12.5 kHz. The tests feed sines through the filters at 48 and 44.1 kHz and compare the result with the standard's design values.&lt;/p&gt;

&lt;h2&gt;
  
  
  From samples to a level
&lt;/h2&gt;

&lt;p&gt;Each weighted sample is squared. Everything after that is an average of those squares:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The number on screen is an exponential average with a time constant of 125 ms (Fast) or 1 s (Slow), the two responses a hardware meter offers.&lt;/li&gt;
&lt;li&gt;Every second, the plain mean of that second's squares becomes one stored row: the second's Leq, plus the highest and lowest Fast/Slow level inside it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Leq, the equivalent continuous level, is the number noise standards are written in. It is an average of energy, not of decibels, so the Leq of a recording is &lt;code&gt;10·log10&lt;/code&gt; of the mean of the per-second energies. A test pins this down: one second at 60 dB and one at 70 dB give 67.4 dB, not 65.&lt;/p&gt;

&lt;p&gt;That distinction matters for the app's main use. Footsteps upstairs are short and loud. They barely move a night's Leq, but they show up in the per-second maximum, which is why the app keeps both.&lt;/p&gt;

&lt;p&gt;The first half second after starting is thrown away. The filter needs to settle, and without that the start-up ramp would be recorded as the minimum of every session.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hard part: dBFS is not dB
&lt;/h2&gt;

&lt;p&gt;Everything above produces dBFS, a level relative to the largest number the converter can represent. A full-scale sine reads −3.01. A sound level meter shows dB SPL, relative to 20 micropascals. The two differ by a constant that depends on the microphone and the hardware around it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;level&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="n"&gt;dBFS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;dBFS&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="c1"&gt;// total = model + user&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That constant is the whole accuracy story. The app ships with a default offset measured on one iPhone, in a table keyed by the model identifier from &lt;code&gt;uname&lt;/code&gt;, and I do not claim a margin of error for it. What it offers instead is calibration: put the phone next to a real sound level meter set to A-weighting, play a steady noise, type in the meter's reading, and the app stores the difference as a user offset in 0.1 dB steps. Every recording keeps the offset and calibration state it was measured with.&lt;/p&gt;

&lt;p&gt;Two quick checks come before that, for people without a meter: a quiet-room check (does the level drop when the room is quiet?) and a response check (does the reading move at least 15 dB when you turn the TV up and down?). They can't make the phone accurate. They catch a blocked or broken microphone, which is the more common failure.&lt;/p&gt;

&lt;p&gt;A calibration offset also can't fix physics. The microphone has a self-noise floor, so a very quiet room never reads as quiet as it is, and a loud enough sound clips the converter. No offset corrects either, and the app tells people its readings are a reference, not a certified measurement.&lt;/p&gt;

&lt;h2&gt;
  
  
  A whole night without recording audio
&lt;/h2&gt;

&lt;p&gt;The app never writes audio to disk. People put this next to their bed, and a level meter has no reason to keep what was said in the room. What is stored per second is three numbers, Leq, max and min, as 16-bit hundredths of a decibel. That is 6 bytes a second, so twelve hours is about 259 KB.&lt;/p&gt;

&lt;p&gt;Rows are flushed to storage every ten seconds, so a crash or a dead battery loses almost nothing, and a session left open by a kill is recovered at the next launch.&lt;/p&gt;

&lt;p&gt;Phone calls interrupt the audio session. The recording pauses, and the paused seconds are stored as empty slots, not skipped, so every later second keeps its true clock time. That matters when the point of the recording is to say "it was loud at 2:14".&lt;/p&gt;

&lt;h2&gt;
  
  
  Making the number mean something
&lt;/h2&gt;

&lt;p&gt;A bare "52 dB" tells most people nothing. Two things on screen give it meaning.&lt;/p&gt;

&lt;p&gt;Under every reading, the app names a place about as loud: a library, a subway car, a coffee shop. The fifteen examples and their levels come from a noise level guide published on the website of Japan's Ministry of the Environment, and the app picks the nearest one.&lt;/p&gt;

&lt;p&gt;The chart also draws Japan's environmental noise standards for the chosen area type, for example 55 dB by day and 45 dB at night in residential areas. Those standards are assessed outdoors over the whole day or night, so the app labels the comparison as a reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell someone starting the same thing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;.measurement&lt;/code&gt; mode and check which microphone you actually got.&lt;/li&gt;
&lt;li&gt;Implement the weighting from the standard's poles, then test it against the standard's table. It is less code than it sounds.&lt;/li&gt;
&lt;li&gt;Average energy, never decibels.&lt;/li&gt;
&lt;li&gt;Be plain about calibration. An uncalibrated phone gives a useful relative reading and an unknown absolute one, and users deserve to know which is which.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Noise Meter is on the App Store for iPhone as "Noise Meter - Decibel Level": &lt;a href="https://w-lab.app/apps/noise-meter/" rel="noopener noreferrer"&gt;https://w-lab.app/apps/noise-meter/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>audio</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
