A Magisk / KernelSU / APatch module that cleans both your microphone and the audio you hear in real time using open-source speech-enhancement models — configurable from a WebUI.
Clarifae installs one native effect library (libclarifae.so) that exposes two
descriptors, registered via audio_effects.xml:
- a capture pre-processor on input streams (microphone, calls/VoIP, camcorder, voice recognition) — cleans your outgoing voice; and
- a playback post-processor on output streams (media/music, calls, …) — cleans the audio you hear.
Each side can be toggled independently and is denoised on the fly by one of three engines, selectable as clarity modes.
Note on output + music: these are speech-enhancement models. On voice content (calls, videos, podcasts) output cleanup clarifies nicely; on actual music it treats instruments as noise and degrades them — use the separate Playback strength slider (or turn output off) to taste.
Brand: primary
#435787, secondary#68aaf3, font Creative Caps.
- Clarity modes
- Features
- Requirements
- Quick start
- How it works
- Configuration reference
clarifae-ctlcommands- Limitations & caveats
- Licensing & credits
| Mode | Engine | Profile | Status |
|---|---|---|---|
| 1 · Low latency | RNNoise | Compact RNN denoiser, lowest CPU/latency, 48 kHz framed | ✅ Default, works out of the box |
| 2 · Balanced | DTLN | Dual-signal LSTM via TensorFlow Lite, stronger denoising | |
| 3 · Maximum clarity | DeepFilterNet | Full-band 48 kHz deep filtering, highest quality | libdf + model |
Modes 2 and 3 are optional builds. If their runtime/models aren't present, Clarifae transparently falls back to RNNoise — it never silently breaks your audio.
- Both directions: mic input and playback output cleanup, each toggleable, from one native AudioFlinger effect (pre-processing + post-processing descriptors).
- Three AI clarity modes with graceful fallback.
- Branded WebUI: master + per-side toggles, mode picker, separate mic/playback strength, max-suppression / voice-gate sliders, high-pass & auto-gain, capture-source and playback-stream selection, live engine status, logs.
- Live, reboot-free settings via
persist.clarifae.*properties (the effect re-reads on change). clarifae-ctlCLI for scripting and debugging.- Clean uninstall — the original
audio_effects.xmlis only shadowed, never edited.
- A rooted Android device with Magisk ≥ 24.0, KernelSU, or APatch.
- For the WebUI: KernelSU/APatch have a built-in WebUI launcher; on Magisk, install MMRL to open module WebUIs.
- To build from source: Android NDK (r27+), CMake, and network access for
fetch_deps.sh.
# from the project folder:
# 1. fetch RNNoise + weights, then build the native effect for all ABIs
./scripts/fetch_deps.sh
./build.sh # -> lib/<abi>/
# 2. package a flashable zip
./scripts/package.sh # -> dist/clarifae-v1.0.0.zip
# 3. flash dist/clarifae-v1.0.0.zip in Magisk/KernelSU/APatch, reboot
# 4. open the Clarifae WebUI, toggle it on, pick a modeSee INSTALL.md for details, optional DTLN/DeepFilterNet builds, and verification steps.
INPUT mic app ─▶ AudioRecord ─▶ capture chain ─┐ <preprocess> → clarifae_ns
├─▶ libclarifae.so (effect.c)
OUTPUT media/call ◀─ AudioTrack ◀─ playback mix ─┘ <postprocess> → clarifae_out
│ s16/float ⇄ float, live config from persist.clarifae.*
▼
backend: rnnoise │ dtln │ deepfilternet
│ resample ⇄ engine rate, frame, enhance, wet/dry + atten cap
▼
cleaned audio ─▶ back to the app (input) / to the speaker (output)
Configuration flows: WebUI → clarifae-ctl → config.conf → persist.clarifae.* →
effect. The effect detects a property change (via the property serial) and reloads
parameters / re-opens the backend on the next audio buffer, so most changes apply without
a reboot. See docs/ARCHITECTURE.md.
/data/adb/clarifae/config.conf is the source of truth (edited by the WebUI/clarifae-ctl)
and is mirrored to system properties the effect reads:
Key / property persist.clarifae.* |
Values | Default | Meaning |
|---|---|---|---|
enabled |
0 / 1 |
1 |
Master on/off (bypass = passthrough) |
in_enabled |
0 / 1 |
1 |
Clean the microphone (input) |
out_enabled |
0 / 1 |
1 |
Clean playback (output) |
mode |
1 / 2 / 3 |
1 |
RNNoise / DTLN / DeepFilterNet |
strength |
0–100 |
70 |
Wet/dry blend for the mic |
out_strength |
0–100 |
60 |
Wet/dry blend for playback (lower for music) |
atten_db |
0–60 |
24 |
Max suppression depth (protects tone) |
vad |
0–100 |
50 |
Voice-activity sensitivity (gate / auto-gain) |
targets |
csv of mic,voice_comm,camcorder,voice_rec |
mic,voice_comm |
Capture sources (input) |
out_targets |
csv of music,voice_call,ring,alarm,notification,system |
music,voice_call |
Playback streams (output) |
highpass |
0 / 1 |
1 |
DC/rumble high-pass pre-filter |
autogain |
0 / 1 |
0 |
Gentle make-up gain on speech |
loglevel |
0–3 |
1 |
logcat verbosity (tag Clarifae) |
Effect UUIDs: input (pre-proc) c1a71fae-0001-… (type = AOSP noise-suppression);
output (post-proc) c1a71fae-0002-… (custom Clarifae type).
clarifae-ctl get # print config.conf
clarifae-ctl get-json # settings as JSON
clarifae-ctl set KEY VALUE # validate + write config + sync property
clarifae-ctl set-many K=V K=V… # batch set
clarifae-ctl apply # push all config -> persist.clarifae.*
clarifae-ctl status # human-readable engine status
clarifae-ctl status-json # status as JSON (used by the WebUI)
clarifae-ctl restart-audio # respawn audioserver to reload effects
clarifae-ctl reset # restore defaults
clarifae-ctl log # tail ctl log + logcat -s Clarifae
clarifae-ctl version
- Auto-attach is device-dependent. It edits the device's
audio_effects.xmlvia an overlay. Some vendors use non-standard formats/locations; if patching fails the library is still installed and you can attach it manually (see docs/TROUBLESHOOTING.md). - Not every app/stream gets cleaned. Effects apply per audio source (input) and per
stream type (output). Apps using their own DSP, a raw/
unprocessedsource, direct/offload output, or exotic routes may bypass it. New sessions pick up changes; some need arestart-audio. - Output post-processing support varies by device more than input pre-processing — some
ROMs ignore or restrict
<postprocess>stream effects. - Music will be degraded if you enable output on the
musicstream — these are speech models. Use Playback strength or disable playback cleanup for music. - SELinux/vendor variance.
persist.clarifae.*live underdefault_prop; a defensivesepolicy.ruleis included for stricter devices. - DTLN/DeepFilterNet are experimental and require extra runtimes/models; without them Clarifae uses RNNoise.
- Real-time enhancement adds a small fixed latency (~10 ms for RNNoise + resampler).
Clarifae module code is provided as-is for the brand owner. It builds on:
- RNNoise — BSD-3-Clause — https://github.com/xiph/rnnoise
- DeepFilterNet — MIT / Apache-2.0 — https://github.com/Rikorose/DeepFilterNet
- DTLN — see repo — https://github.com/breizhn/DTLN · web: https://github.com/sapphi-red/DTLN-web
- RNNoise voice plugin — https://github.com/werman/noise-suppression-for-voice
- DTLN-AEC (echo cancellation) — https://github.com/breizhn/DTLN-aec
- The vendored
native/include/audio_effect.his a trimmed AOSP-compatible ABI header (Apache-2.0, The Android Open Source Project).
Verify each upstream license before redistribution. TensorFlow Lite (DTLN backend) is Apache-2.0.