From 2383a9261bb2f8c96e2812c3150e1bbfc41582cd Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 12 Feb 2021 13:34:29 +0100 Subject: Add setup-noise-suppression Signed-off-by: Florian Pritz --- setup-noise-suppression | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 setup-noise-suppression (limited to 'setup-noise-suppression') diff --git a/setup-noise-suppression b/setup-noise-suppression new file mode 100755 index 0000000..699ca42 --- /dev/null +++ b/setup-noise-suppression @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Set up rnnoise-based microphone noise filtering +# +# - Install the ladspa noise-suppression plugin form here: https://github.com/werman/noise-suppression-for-voice +# - Then use this script to play around with the settings until you have something that works well. +# + Find potential sources with: pacmd list-sources | awk -F'[<>]' '/name: /{print $2}' +# - Finally, put the "load-module *" lines into your /etc/pulse/default.pa for persistence. + +source="$1" +control="${2:-40}" +channels="${3:-2}" + +pacmd unload-module module-null-sink + +pacmd load-module module-null-sink sink_name=mic_denoised_out rate=48000 format=s16le +pacmd load-module module-ladspa-sink sink_name=mic_raw_in sink_master=mic_denoised_out label=noise_suppressor_mono plugin=/usr/lib/ladspa/librnnoise_ladspa.so control="$control" +pacmd load-module module-loopback source="$source" sink=mic_raw_in channels="$channels" source_dont_move=true sink_dont_move=true latency_msec=1 + +# remap to regular source for chromium +pacmd load-module module-remap-source source_name=denoised master=mic_denoised_out.monitor channels="$channels" -- cgit v1.2.3-24-g4f1b