<?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: Lance Kong</title>
    <description>The latest articles on DEV Community by Lance Kong (@lance_kong).</description>
    <link>https://dev.to/lance_kong</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%2F3874674%2F5ad26bee-cba6-4452-8e29-b4e8a1209a3d.png</url>
      <title>DEV Community: Lance Kong</title>
      <link>https://dev.to/lance_kong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lance_kong"/>
    <language>en</language>
    <item>
      <title>Why 100% AI Noise Removal Sounds Robotic — and How I Built a 48 kHz Lossless Video Denoiser in the Browser</title>
      <dc:creator>Lance Kong</dc:creator>
      <pubDate>Fri, 27 Nov 2026 14:12:21 +0000</pubDate>
      <link>https://dev.to/lance_kong/why-100-ai-noise-removal-sounds-robotic-and-how-i-built-a-48-khz-lossless-video-denoiser-in-the-4k27</link>
      <guid>https://dev.to/lance_kong/why-100-ai-noise-removal-sounds-robotic-and-how-i-built-a-48-khz-lossless-video-denoiser-in-the-4k27</guid>
      <description>&lt;p&gt;If you have ever filmed an outdoor vlog on an iPhone or GoPro in strong wind—or recorded a podcast next to an AC unit—you have probably tried one of the popular "one-click AI speech enhancers."&lt;/p&gt;

&lt;p&gt;They remove the noise, sure. Then halfway through a fast sentence, your voice suddenly turns into a metallic robot, breathing sounds vanish into eerie digital silence (&lt;code&gt;-∞ dB&lt;/code&gt;), and if your file happens to be an &lt;code&gt;.mp4&lt;/code&gt; or &lt;code&gt;.mov&lt;/code&gt; video, most free web tools reject it outright until you strip the audio yourself.&lt;/p&gt;

&lt;p&gt;While building &lt;a href="https://clearmyclip.com" rel="noopener noreferrer"&gt;ClearMyClip&lt;/a&gt;, I spent weeks digging into why browser-based noise removal feels so frustrating—and how a few classic DSP and FFmpeg decisions fix almost all of it.&lt;/p&gt;

&lt;p&gt;Here is the architecture and the three technical choices that made the biggest difference.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Non-Generative 48 kHz Denoising vs. Generative Resynthesis
&lt;/h2&gt;

&lt;p&gt;Many well-known enhancers use generative models that &lt;strong&gt;re-synthesize&lt;/strong&gt; your voice from scratch. That works great when rescuing a terribly muffled 8 kHz phone call, but on decent modern microphones (iPhone, DJI Mic, USB condensers) with heavy background wind or hum, generative synthesis often mispredicts sibilants (&lt;code&gt;s&lt;/code&gt;, &lt;code&gt;sh&lt;/code&gt;, &lt;code&gt;t&lt;/code&gt;) and erases natural vocal timbre.&lt;/p&gt;

&lt;p&gt;Instead, I built the pipeline around &lt;strong&gt;DeepFilterNet3 running at 48 kHz&lt;/strong&gt; on CPU (chunked inference with strict concurrency locking):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It operates directly in the time-frequency domain to attenuate non-speech noise rather than hallucinating replacement syllables.&lt;/li&gt;
&lt;li&gt;Keeping the entire pipeline at &lt;strong&gt;48.0 kHz&lt;/strong&gt; preserves high-frequency vocal air instead of downsampling to 16 kHz.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Fixing the "Robotic Vacuum" Effect with a Live Web Audio Dry/Wet Mixer
&lt;/h2&gt;

&lt;p&gt;Even with a strong 48 kHz neural denoiser, running noise suppression at &lt;strong&gt;100%&lt;/strong&gt; removes &lt;em&gt;all&lt;/em&gt; room tone. Human ears immediately perceive absolute silence between words as unnatural.&lt;/p&gt;

&lt;p&gt;Audio engineers have solved this in DAWs for decades with &lt;strong&gt;parallel dry/wet blending&lt;/strong&gt;: dial noise reduction back to roughly &lt;strong&gt;75%–88%&lt;/strong&gt;, and the harsh wind rumble or fan hum disappears while a tiny, natural acoustic floor stays intact.&lt;/p&gt;

&lt;p&gt;To make this instantaneous in the browser without re-rendering on the server every time the user moves a slider:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;For the free 30-second preview, the backend returns two sample-aligned WAV stems: the &lt;strong&gt;original (&lt;code&gt;dry&lt;/code&gt;)&lt;/strong&gt; clip and the &lt;strong&gt;100% denoised (&lt;code&gt;wet&lt;/code&gt;)&lt;/strong&gt; clip.&lt;/li&gt;
&lt;li&gt;The browser decodes both into &lt;code&gt;AudioBuffer&lt;/code&gt;s and routes them through two synchronized &lt;code&gt;GainNode&lt;/code&gt;s in the Web Audio API:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Click-free real-time dry/wet mixing in Web Audio API&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;applyDryWetBlend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AudioContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;dryGain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;GainNode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;wetGain&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;GainNode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;strengthPercent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 0..100&lt;/span&gt;
  &lt;span class="n"&gt;isBypass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;wet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;isBypass&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;strengthPercent&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;dry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;wet&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;currentTime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// 15ms linear ramp avoids audible clicks when toggling A/B or scrubbing&lt;/span&gt;
  &lt;span class="n"&gt;dryGain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cancelScheduledValues&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="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;wetGain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cancelScheduledValues&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="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;dryGain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setTargetAtTime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dry&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="mf"&gt;0.015&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;wetGain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setTargetAtTime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wet&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="mf"&gt;0.015&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;Users can press &lt;code&gt;Space&lt;/code&gt; to play, hit &lt;code&gt;A&lt;/code&gt; / &lt;code&gt;B&lt;/code&gt; to toggle Original vs. Cleaned in real time, and drag the strength slider until their voice sounds natural—before spending a single second waiting on a full export.&lt;/p&gt;

&lt;p&gt;I also wrote a deeper breakdown of the 75–88% rule here: &lt;a href="https://clearmyclip.com/en/guides/fix-robotic-ai-voice-dry-wet-rule" rel="noopener noreferrer"&gt;Why AI Voice Cleaners Sound Robotic (and the Dry/Wet Fix)&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Lossless Video Remuxing (&lt;code&gt;-c:v copy&lt;/code&gt;) + 2-Pass Linear &lt;code&gt;-16 LUFS&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;One thing I personally hated about existing web tools was having to open a desktop editor just to detach audio from a 4K &lt;code&gt;.mov&lt;/code&gt; file, denoise it, and re-export the entire video (losing quality and burning 10 minutes of CPU time).&lt;/p&gt;

&lt;p&gt;On the server side, replacing only the audio track while keeping the original video frames 100% bit-for-bit intact is straightforward with FFmpeg stream copy—provided you watch out for two real-world gotchas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ignore album art (&lt;code&gt;attached_pic&lt;/code&gt;) streams&lt;/strong&gt; when mapping video tracks, or FFmpeg will choke trying to mux a JPEG cover stream as video.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preserve Apple's HEVC &lt;code&gt;hvc1&lt;/code&gt; tag&lt;/strong&gt; for iPhone &lt;code&gt;.mov&lt;/code&gt;/&lt;code&gt;.mp4&lt;/code&gt; footage so QuickTime and Safari still play the output natively.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg -y \
  -i input.mov \
  -i cleaned_48k.wav \
  -map 0:v:0 \
  -map 1:a:0 \
  -c:v copy \
  -tag:v hvc1 \
  -c:a aac -b:a 256k -ar 48000 \
  -movflags +faststart \
  output_cleaned.mov
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For quiet recordings (common on lapel mics or outdoor handheld shots), we also run an optional &lt;strong&gt;2-pass linear &lt;code&gt;-16 LUFS&lt;/code&gt; loudness normalization&lt;/strong&gt; (&lt;code&gt;loudnorm&lt;/code&gt; measurement pass → exact measured linear apply pass + brickwall &lt;code&gt;alimiter=limit=0.95&lt;/code&gt;) so exported speech matches YouTube and podcast broadcast standards without pumping background noise back up.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Infrastructure &amp;amp; Privacy Choices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend / API&lt;/strong&gt;: Next.js 15 deployed on Cloudflare Workers (OpenNext) + Cloudflare D1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage&lt;/strong&gt;: Direct browser-to-Cloudflare-R2 presigned uploads (up to 500 MB) with an automatic &lt;strong&gt;24-hour bucket lifecycle expiration rule&lt;/strong&gt; so user media is purged automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-account workflow&lt;/strong&gt;: No mandatory login to test or use—credits live in an anonymous HTTP-only session wallet backed by a cross-device recovery code.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It on Your Own Noisy Clip
&lt;/h2&gt;

&lt;p&gt;If you want to test the real-time dry/wet slider (or even record a 5-second raw mic test directly in the browser—we explicitly set &lt;code&gt;noiseSuppression: false&lt;/code&gt; on &lt;code&gt;getUserMedia&lt;/code&gt; so your actual room noise stays intact for an honest A/B test), you can try it here with no signup:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://clearmyclip.com/en/remove-wind-noise-from-video" rel="noopener noreferrer"&gt;ClearMyClip — 48 kHz Audio &amp;amp; Lossless Video Noise Remover&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear from other devs working with Web Audio, DeepFilterNet, or FFmpeg in production—especially if you've found better tricks for heavy outdoor wind buffeting or browser-side video/audio lip-sync!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>webdev</category>
      <category>ffmpeg</category>
      <category>audio</category>
    </item>
    <item>
      <title>I built a car cost calculator that refuses to pick a side — here's why that was the hard part</title>
      <dc:creator>Lance Kong</dc:creator>
      <pubDate>Wed, 17 Jun 2026 07:53:24 +0000</pubDate>
      <link>https://dev.to/lance_kong/i-built-a-car-cost-calculator-that-refuses-to-pick-a-side-heres-why-that-was-the-hard-part-h4</link>
      <guid>https://dev.to/lance_kong/i-built-a-car-cost-calculator-that-refuses-to-pick-a-side-heres-why-that-was-the-hard-part-h4</guid>
      <description>&lt;p&gt;I'm a solo developer, and over the past few months I built &lt;a href="https://www.carcostiq.com" rel="noopener noreferrer"&gt;CarCostIQ&lt;/a&gt; — a calculator that works out the true 5-year cost of owning a car in Australia, comparing EV vs petrol vs hybrid vs diesel across all 8 states.&lt;/p&gt;

&lt;p&gt;This post isn't really a launch announcement. It's about one design decision that turned out to be harder than all the code: &lt;strong&gt;deciding that the tool should refuse to have an opinion.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with most "EV vs petrol" comparisons
&lt;/h2&gt;

&lt;p&gt;If you search "is an EV cheaper than petrol," almost every result has an agenda. EV advocates show you the scenario where the EV wins. Skeptics show you the one where it loses. Both are technically using real numbers — they're just choosing the inputs that produce the answer they already wanted.&lt;/p&gt;

&lt;p&gt;I didn't want to build another one of those. I wanted a tool that just does the math honestly and tells you whatever the math says — even when that's inconvenient.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "honest" actually means in practice
&lt;/h2&gt;

&lt;p&gt;Here's a real example from the tool, at default settings:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A Toyota Corolla Cross Hybrid comes out &lt;strong&gt;~$2,984 cheaper over 5 years&lt;/strong&gt; than a BYD Atto 3.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The EV loses. And the tool says so, plainly, with no "but think of the environment" deflection. That felt almost uncomfortable to ship — there's a strong cultural pull to make the EV look good. But the moment a tool nudges you toward a conclusion, it stops being a calculator and becomes an advertisement.&lt;/p&gt;

&lt;p&gt;The honest answer is almost always: &lt;strong&gt;it depends on you.&lt;/strong&gt; So the tool makes you set your own annual km, your state, and your home-charging mix — and the verdict genuinely flips based on those. The job of the tool isn't to tell you the answer. It's to let you find &lt;em&gt;your&lt;/em&gt; answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The parts that were actually hard
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data integrity.&lt;/strong&gt; Every vehicle is checked against the manufacturer's configurator and official ADR fuel/energy figures — not secondary blog estimates. 53 models so far, and keeping them accurate is ongoing work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resisting the urge to simplify.&lt;/strong&gt; It would be easier to show one headline number. But running costs depend on depreciation, insurance, charging tariffs, state differences — so the tool shows the full 5-year breakdown and an 8-state comparison, and publishes every assumption with its source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not hiding the answer behind a paywall.&lt;/strong&gt; The full result is free — verdict, breakdown, comparison, sensitivity analysis. (There's an optional paid report you can take away, but the actual answer is, and stays, free.) Hiding the conclusion would have betrayed the whole "honest" premise.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I'd love feedback on
&lt;/h2&gt;

&lt;p&gt;It's live at &lt;a href="https://www.carcostiq.com" rel="noopener noreferrer"&gt;carcostiq.com&lt;/a&gt; if you want to try it with your own numbers. I'm especially interested in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does the "no opinion" framing actually come through, or does it still feel like it's nudging you somewhere?&lt;/li&gt;
&lt;li&gt;If you find a number you disagree with, tell me — every assumption has a published source and I'll fix what's wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm building in public, so I'll keep sharing what I learn. Thanks for reading.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>indiehackers</category>
      <category>showdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
