diff options
author | Florian Pritz <bluewind@xinu.at> | 2021-02-12 13:34:29 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2021-02-12 13:36:53 +0100 |
commit | 2383a9261bb2f8c96e2812c3150e1bbfc41582cd (patch) | |
tree | 2777590acf1e0d8bb4ed5379c4fb6691acf86390 /setup-noise-suppression | |
parent | 18ae31f04b37c89a674da89061068d682c38a637 (diff) | |
download | bin-2383a9261bb2f8c96e2812c3150e1bbfc41582cd.tar.gz bin-2383a9261bb2f8c96e2812c3150e1bbfc41582cd.tar.xz |
Add setup-noise-suppression
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'setup-noise-suppression')
-rwxr-xr-x | setup-noise-suppression | 21 |
1 files changed, 21 insertions, 0 deletions
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" |