為何 100% AI 降噪聽起來像機械人:我如何在瀏覽器打造 48 kHz 無損影片降噪工具
Why 100% AI Noise Removal Sounds Robotic — and How I Built a 48 kHz Lossless Video Denoiser in the Browser
ClearMyClip 作者説明如何在瀏覽器打造 48 kHz 無損影片降噪工具,以 DeepFilterNet3 在 CPU 上處理噪音,並保留原有影片畫面。工具以 dry/wet 混音調整降噪強度,避免完全消除環境底噪造成不自然的聲音;伺服器則透過 FFmpeg stream copy 替換音軌,並提供可選的 -16 LUFS 音量標準化。
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."
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 (-∞ dB), and if your file happens to be an .mp4 or .mov video, most free web tools reject it outright until you strip the audio yourself.
While building ClearMyClip, 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.
Here is the architecture and the three technical choices that made the biggest difference.
1. Non-Generative 48 kHz Denoising vs. Generative Resynthesis
Many well-known enhancers use generative models that re-synthesize 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 (s, sh, t) and erases natural vocal timbre.
Instead, I built the pipeline around DeepFilterNet3 running at 48 kHz on CPU (chunked inference with strict concurrency locking):
- It operates directly in the time-frequency domain to attenuate non-speech noise rather than hallucinating replacement syllables.
- Keeping the entire pipeline at 48.0 kHz preserves high-frequency vocal air instead of downsampling to 16 kHz.
2. Fixing the "Robotic Vacuum" Effect with a Live Web Audio Dry/Wet Mixer
Even with a strong 48 kHz neural denoiser, running noise suppression at 100% removes all room tone. Human ears immediately perceive absolute silence between words as unnatural.
Audio engineers have solved this in DAWs for decades with parallel dry/wet blending: dial noise reduction back to roughly 75%–88%, and the harsh wind rumble or fan hum disappears while a tiny, natural acoustic floor stays intact.
To make this instantaneous in the browser without re-rendering on the server every time the user moves a slider:
- For the free 30-second preview, the backend returns two sample-aligned WAV stems: the original (
dry) clip and the 100% denoised (wet) clip. - The browser decodes both into
AudioBuffers and routes them through two synchronizedGainNodes in the Web Audio API:
// Click-free real-time dry/wet mixing in Web Audio API
function applyDryWetBlend(
ctx: AudioContext,
dryGain: GainNode,
wetGain: GainNode,
strengthPercent: number, // 0..100
isBypass: boolean
) {
const wet = isBypass ? 0 : Math.max(0, Math.min(1, strengthPercent / 100));
const dry = 1 - wet;
const now = ctx.currentTime;
// 15ms linear ramp avoids audible clicks when toggling A/B or scrubbing
dryGain.gain.cancelScheduledValues(now);
wetGain.gain.cancelScheduledValues(now);
dryGain.gain.setTargetAtTime(dry, now, 0.015);
wetGain.gain.setTargetAtTime(wet, now, 0.015);
}
Users can press Space to play, hit A / B 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.
I also wrote a deeper breakdown of the 75–88% rule here: Why AI Voice Cleaners Sound Robotic (and the Dry/Wet Fix).
3. Lossless Video Remuxing (-c:v copy) + 2-Pass Linear -16 LUFS
One thing I personally hated about existing web tools was having to open a desktop editor just to detach audio from a 4K .mov file, denoise it, and re-export the entire video (losing quality and burning 10 minutes of CPU time).
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:
-
Ignore album art (
attached_pic) streams when mapping video tracks, or FFmpeg will choke trying to mux a JPEG cover stream as video. -
Preserve Apple's HEVC
hvc1tag for iPhone.mov/.mp4footage so QuickTime and Safari still play the output natively.
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
For quiet recordings (common on lapel mics or outdoor handheld shots), we also run an optional 2-pass linear -16 LUFS loudness normalization (loudnorm measurement pass → exact measured linear apply pass + brickwall alimiter=limit=0.95) so exported speech matches YouTube and podcast broadcast standards without pumping background noise back up.
4. Infrastructure & Privacy Choices
- Frontend / API: Next.js 15 deployed on Cloudflare Workers (OpenNext) + Cloudflare D1.
- Storage: Direct browser-to-Cloudflare-R2 presigned uploads (up to 500 MB) with an automatic 24-hour bucket lifecycle expiration rule so user media is purged automatically.
- Zero-account workflow: No mandatory login to test or use—credits live in an anonymous HTTP-only session wallet backed by a cross-device recovery code.
Try It on Your Own Noisy Clip
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 noiseSuppression: false on getUserMedia so your actual room noise stays intact for an honest A/B test), you can try it here with no signup:
👉 ClearMyClip — 48 kHz Audio & Lossless Video Noise Remover
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!
來源:DEV Community · dev.to