PipeWire/Microphone Noise Suppression

From Gentoo Wiki
Jump to:navigation Jump to:search

During video meetings or other voice recordings, background noise can make it harder for people to understand you. Fans, mechnicaly keyboards, construction and more can make it harder for others to hear you.

Using a LADSPA plugin for PipeWire that you can automatically filter background noise when you're using your microphone.


Microphone noise can be reduced using noise-suppression-for-voice.

Installation

Emerge

root #emerge --ask media-libs/noise-suppression-for-voice


Configuration

FILE ~/.config/pipewire/pipewire.conf.d/99-input-denoising.conf
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/lib64/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
            }
        }
    }
]

Service

Systemd

Restart PipeWire:

user $systemctl restart --user pipewire.service