Voice isolation on par with Discord #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
robocub/vommet#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Background noise (keyboards, fans, kids, TV) is one of the first things Discord users notice when they try Matrix calls. Discord ships Krisp, which is proprietary; we need an open equivalent.
What exists
Only libwebrtc's built-in processing:
commet/lib/client/components/voip/webrtc_default_devices.dartasks forechoCancellation: true,noiseSuppression: true,autoGainControl: false. The LiveKit path (matrix_livekit_backend.dart) passes only a device id. libwebrtc's suppressor handles steady hiss, not keyboards or voices in the room. Upstream has the same request open (Commet #603).Options
The hard part
Inserting processing into the capture path. flutter_webrtc has no audio-processing hook on desktop. Commet already pins its own forks of flutter-webrtc and the LiveKit Flutter SDK, so the realistic route is a capture post-processing hook in that fork (libwebrtc's APM supports a custom capture post-processor), calling into the Rust library. Needs a per-platform look at Linux and Windows first; Android has its own capture path.
Plan
Acceptance
A/B recordings with keyboard typing and a fan, the same mic, judged by ear by at least two people. CPU stays reasonable on a low-end laptop.
Filed with LLM assistance. This is a fork-only issue; never refile it on Commet's tracker.
Research: where noise suppression can plug in (2026-10-05)
Short version: the hook already exists on desktop; nobody calls it.
What's there
commetchat/flutter-webrtc@hkdf(2d0dce5) andcommetchat/livekit-client-sdk-flutter@hkdf.libwebrtc.zipfrom upstream flutter-webrtc v1.4.0 (March 2026), which wraps WebRTC in webrtc-sdk/libwebrtc.RTCAudioProcessingsince July 2025 (webrtc-sdk/libwebrtc #108): andRTCPeerConnectionFactory::GetAudioProcessing().common/cpp/src/flutter_webrtc_base.cc:22:audio_processing_ = factory_->GetAudioProcessing();) but exposes no method to install a processor. Our Linux CI build links against it, so the v1.4.0 prebuilt does ship it.audio->channels()[0]); at 48 kHz that's 480 samples. That is exactly RNNoise's frame size and sample scale, so no resampling or reframing is needed at 48 kHz.AudioProcessingAdapter(ExternalAudioFrameProcessing.process(numBands, numFrames, ByteBuffer)). That's what LiveKit's noise-filter plugins use on mobile.Proposed design (desktop first)
commetchat/flutter-webrtc@hkdf: a method-channel callsetCapturePostProcessor(fn, userData)that takes a native function pointer (void process(void* user, int frames, float* buf)) and wraps it in aCustomProcessing;fn = 0removes it. Roughly 100 lines of C++, no new dependencies, and the plugin stays model-agnostic.rust_lib_commeton Linux and Windows. Add nnnoiseless (a pure-Rust RNNoise port, BSD-3) and export anextern "C"processor with one state per stream. A later "Strong" mode can swap in DeepFilterNet (MIT/Apache, Rust) behind the same function pointer.dart:ffi, pass its address to the plugin, and add a setting Off / Standard / Strong. Standard is today's WebRTC suppressor; Strong is RNNoise on top.AudioProcessingAdapter, through JNI or a Kotlin RNNoise binding.Effort and risks
Filed with LLM assistance.