Development Log: Achieving 'Minimum Noise Suppression × Voiceprint Gate' in Pure Rust After Encountering Challenges with Noise and Other People's Voices in Speech Input
Introduction: A Self-Built Voice Input System That Worked Perfectly in a Quiet Room
I stopped typing on the keyboard and aimed for an ideal where I could think directly and convert my voice into text instantly.
To pursue this dream, I developed a custom high-speed Japanese voice input daemon called Voice-Typer (Pure Rust + Whisper), leveraging a GPU (RTX 3060).
In the quiet environment of my home office, it was incredibly comfortable. Text appeared on the screen as if being sucked in at around 0.3 seconds from the moment I opened my mouth. I became convinced that “I can never go back to manual typing.”
However—taking this comfortable system just one step outside (to a cafe, train station platform, road intersection, or living room with family) immediately brought me face-to-face with two massive real-world walls.
Wall #1: Going Outside Makes It Unusable Due to “Environmental Noise”
The first obstacle was “street environmental noise (wind noise, vehicle running noise, HVAC sounds)”.
The microphone that worked perfectly in a quiet room bared its teeth as soon as I went outdoors.
- Speaking while walking caused the microphone to pick up strong low-frequency rumble from gusts of wind or truck road noise.
- The speech recognition engine, Whisper, when encountering sections of pure noise, forcibly fabricates words, outputting mysterious English hallucinations (e.g.,
Please create a big yellow...).
Looking at the screen, I saw mysterious English sentences and meaningless symbols that I hadn’t spoken, completely interrupting my train of thought.
[Solution #1]: Introducing RNNoise for Noise Cancellation
“First, I must cleanly eliminate surrounding physical noise.”
Therefore, I incorporated RNNoise (Neural Network-based Adaptive Noise Suppression) into the front end of the pure Rust audio pipeline.
flowchart LR
Mic["Microphone Input (16kHz)"] --> RNNoise["RNNoise<br>(AI Noise Cancellation)"] --> Whisper["Whisper<br>Transcription"]
RNNoise estimates and removes stationary and non-stationary environmental noise from the audio in just a few milliseconds per frame.
The sound of air conditioner fans, distant car rumbling, and low-frequency gusts vanished smoothly, leaving only my voice clearly floating through the microphone.
“Great, the noise problem is solved! I can use voice input comfortably anywhere!”
At that time, I patted myself on the back thinking so.
Wall #2: Even After Noise Cancellation, “Other People’s Voices” Cannot Be Blocked

However, in cafes or crowded places that I visited next, a more troublesome and essential wall awaited me.
- The microphone clearly picked up conversations from the seat next to me in a cafe, shop staff announcements, or TV audio in the living room.
- Whisper, being extremely excellent, diligently transcribes anyone’s voice if it is “human speech.”
As a result, a tragedy occurred where private small talk between neighbors was automatically typed onto the screen even during moments of silence when I wasn’t speaking.
Failure: “If We Just Make Noise Cancellation Stronger?”
“I thought, ‘If we increase RNNoise’s suppression ratio to a more powerful level (80%~90% suppression), shouldn’t distant voices from others be eliminated as noise?’”
However, here I faced the cruel dilemma of acoustics.
- RNNoise Cannot Distinguish “Other People’s Voices”:
RNNoise is an AI that separates “human voice vs. other environmental sounds.” For RNNoise, both “my voice” and “the neighbor customer’s voice” are equally voices to be protected, making it impossible to eliminate others’ voices as noise by principle. - Excessive Noise Suppression Destroys Voice Quality:
If we forcibly apply intense noise suppression, along with environmental sounds, delicate harmonic components of the voice (high-frequency formants) and consonants (sibilants like ‘s’, ‘t’, ‘p’) are stripped away, resulting in an unnatural robot voice as if speaking underwater. Consequently, Whisper’s recognition accuracy plummeted.
“Environmental noise” and “other people’s voices” were completely different things.
It was a mistake to try to carry everything on the single tool of noise cancellation.
Solution #2: Reject Other People’s Voices via “Speaker Verification” Instead of Noise Suppression
“I realized that trying to eliminate other people’s voices with noise cancellation was wrong.”
From this realization, I made a major turn in the architecture.
“Environmental noise is reduced by noise cancellation, but other people’s voices are ruthlessly discarded via ‘speaker verification (is this really my voice?)’ right before being passed to speech recognition (Whisper).”
Instead of setting up a heavy separate Python process, I directly incorporated a super-lightweight 26MB ONNX model (WeSpeaker ResNet-34) into Voice-Typer (pure Rust standalone binary).

Core: The Golden Ratio Reached at “Minimum Noise Suppression × Speaker Gate”
Here, the system’s biggest breakthrough was born.
“If we apply too much noise cancellation, the harmonics of the voice are stripped away, causing speaker verification (WeSpeaker) to even reject my own voice.” This is a technical trade-off.
Speaker verification (WeSpeaker) identifies individuals by looking not only at the fundamental frequency of the vocal cords but also at subtle harmonic components generated from the shape of the vocal tract and bone structure. If noise cancellation flattens the voice, speaker verification goes haywire.
Therefore, I strictly redesigned the division of labor between the two technologies as follows:
flowchart LR
Mic["Microphone Input (16kHz)"] --> Denoise["RNNoise<br>Mild Fixed Noise Suppression (30%)"]
Denoise --> VAD{"VAD Gate<br>Is there voice volume?"}
VAD -- No --> Skip1["Skip<br>(Silence / Minimal Noise)"]
VAD -- Yes --> Speaker{"Speaker Gate<br>Matches my speaker embedding?"}
Speaker -- "Similarity < 0.45" --> Skip2["Skip<br>(Other voices, TV, etc.)"]
Speaker -- "Similarity >=