A real-time noise suppression plugin for voice based on Xiph's RNNoise. More info about the base library.
The plugin is meant to suppress a wide range of noise origins (from original paper): computer fans, office, crowd, airplane, car, train, construction.
From my tests mild background noise is always suppressed, loud sounds, like clicking of mechanical keyboard, are suppressed while there is no voice however they are only reduced in volume when voice is present.
Please note that this plugin could not improve the voice quality with bad microphone, it even could make things worse by misclassifying the voice as a noise which would reduce already not-so-good voice quality.
The plugin works with one or more channels, 16 bit, 48000 Hz audio input.
:exclamation: :exclamation: :exclamation: Do NOT use any other sample rates, use ONLY 48000 Hz, make sure your audio source is 48000 Hz and force it to be 48000 Hz if it is not.
There is a minimalistic GUI with all parameters and diagnostic stats:
VAD Threshold (%)
- if probability of sound being a voice is lower than this threshold - it will be silenced.
In most cases the threshold between 85% - 95% would be fine.
Without the VAD some loud noises may still be a bit audible when there is no voice.VAD Grace Period (ms)
- for how long after the last voice detection the output won't be silenced. This helps when ends of words/sentences are being cut off.Retroactive VAD Grace Period (ms)
- similar to VAD Grace Period (ms)
but for starts of words/sentences. :warning: This introduces latency!To check or change mic settings go to "Recording devices" -> "Recording" -> "Properties" of the target mic -> "Advanced".
To enable the plugin in Equalizer APO select "Plugins" -> "VST Plugin" and specify the plugin dll.
See detailed guide provided by @bssankaran.
Since version 0.3.45
PipeWire uses Split-File Configuration, making it extremely easy to set up plugins and tweak configuration.
For older PipeWire version you'd have to copy /usr/share/pipewire/pipewire.conf
into ~/.config/pipewire/pipewire.conf
and then append the configuration below to already existing context.modules
.
For PipeWire >= 0.3.45
you should:
Create config directory: ~/.config/pipewire/pipewire.conf.d/
Create config for plugin: ~/.config/pipewire/pipewire.conf.d/99-input-denoising.conf
Paste configuration:
context.modules = [
{ name = libpipewire-module-filter-chain
args = {
node.description = "Noise Canceling source"
media.name = "Noise Canceling source"
filter.graph = {
nodes = [
{
type = ladspa
name = rnnoise
plugin = /path/to/librnnoise_ladspa.so
label = noise_suppressor_mono
control = {
"VAD Threshold (%)" = 50.0
"VAD Grace Period (ms)" = 200
"Retroactive VAD Grace (ms)" = 0
}
}
]
}
capture.props = {
node.name = "capture.rnnoise_source"
node.passive = true
audio.rate = 48000
}
playback.props = {
node.name = "rnnoise_source"
media.class = Audio/Source
audio.rate = 48000
}
}
}
]
Change /path/to/librnnoise_ladspa.so
to actual library path
If you are absolutely sure that you need stereo output - change noise_suppressor_mono
-> noise_suppressor_stereo
. Even if your mic says that it is stereo - you probably don't need stereo output. It also would consume 2x resources.
Configure plugin parameters: VAD Threshold (%)
, ...
Restart PipeWire: systemctl restart --user pipewire.service
Now you should be able to select Noise Canceling source
as input device
For more information consult PipeWire documentation on Filter-Chains
Troubleshooting:
Alternative solutions for PipeWire/PulseAudio configuration which also use RNNoise:
TLDR: Use PipeWire... or follow the instructions below.
TODO, contributions are welcomed!
The plugin is tested with:
I'm not associated with the original RNNoise work and do NOT have any understanding of recurrent neural networks it is based upon.
External dependencies are vendored via git-subrepo. So that there is no need to use submodules, and patching subrepos is easy (at the moment we have several patches for JUCE).
Improvements are welcomed! Though if you want to contribute anything sizeable - open an issue first.
Compiling for x64:
cmake -Bbuild-x64 -H. -GNinja -DCMAKE_BUILD_TYPE=Release
ninja -C build-x64
Compiling for x32:
cmake -D CMAKE_CXX_FLAGS=-m32 -D CMAKE_C_FLAGS=-m32 -Bbuild-x32 -H. -GNinja -DCMAKE_BUILD_TYPE=Release
ninja -C build-x32
Cross-compiling for Windows x64 (MinGW builds are failing at the moment due to certain incompatibilities in JUCE):
cmake -Bbuild-mingw64 -H. -GNinja -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-mingw64.cmake -DCMAKE_BUILD_TYPE=Release
ninja -C build-mingw64
By default, all plugins supported for a platform are being built. You can deliberately turn off plugins with the following CMake flags:
BUILD_LADSPA_PLUGIN
BUILD_VST_PLUGIN
BUILD_VST3_PLUGIN
BUILD_LV2_PLUGIN
BUILD_AU_PLUGIN
(macOS only)BUILD_AUV3_PLUGIN
(macOS only)For example:
cmake -DBUILD_VST_PLUGIN=OFF -DBUILD_LV2_PLUGIN=OFF
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Used libraries: