Graphics card

Awesome Linux Game Tools: noise-suppression-for-voice

Awesome Linux Game Tools is a series of reviews showcasing the finest tools for Linux gamers.

Noise suppression is a pretty old topic in speech processing, dating back to at least the 1970s. As the name implies, the idea is to take a noisy signal and remove as much noise as possible while causing minimum distortion to the speech of interest.

noise-suppression-for-voice is a noise suppression plugin based on RNNoise, a noise suppression library based on a recurrent neural network (RNN). A RNN is a class of artificial neural networks where connections between nodes can create a cycle, allowing output from some nodes to affect subsequent input to the same nodes. RNNs are particularly effective for background noise removal because they can learn patterns across time which is essential for understanding audio.

noise-suppression-for-voice isn’t only useful for gamers who are live streaming and recording. It can be used to suppress noise in a wide range of applications.

Installation

We tested the software in Arch. There’s a package in the Arch User Repository, which we installed with the yay helper.

$ yay -S noise-suppression-for-voice

There’s manual configuration needed. We need to create a config directory

$ mkdir ~/.config/pipewire/

Next create a pipewire.conf.d directory.

$ mkdir ~/.config/pipewire/pipewire.conf.d/

We need to create a configuration file (99-input-denoising.conf) for the plugin. Use any text editor such as nano.

$ nano ~/.config/pipewire/pipewire.conf.d/99-input-denoising.conf

Paste the contents below into that file.

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 = /usr/lib/ladspa/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
        }
    }
}
]

You need to specify where librnnoise_ladspa.so is stored. With the AUR package that’s at /usr/lib/. We’ve bolded the line which you need to edit if the .so file is stored in a different location on your system.

Restart PipeWire with the command:

$ systemctl restart --user pipewire.service

If you’re running PulseAudio instead of PipeWire, you’ll need to follow different configuration steps. They are detailed on the project’s GitHub page. We only tested noise-suppression-for-voice with PipeWire.

Next page: Page 2 – In Operation and Summary

Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments