werman / noise-suppression-for-voice

Noise suppression plugin based on Xiph's RNNoise
GNU General Public License v3.0
4.88k stars 230 forks source link

Usage instructions / Sensible Pulseaudio names. #98

Open kingsly opened 2 years ago

kingsly commented 2 years ago

Thanks for this awesome piece of software! :-)

This script should work for most typical pulseaudio setups with only one sound card.

It also overrides the confusing default PulseAudio names "Null Output" "Monitor of Null Output" etc. with more user friendly ones.

It creates both usable mic sources so users can choose whatever shows up in the software they want to use the mic with.

Feel free to modify as you see fit or if you need me to make any changes or make it more user friendly let me know.

Usage: pa-denoise.sh /path/to/librnnoise_ladspa.so

#!/bin/bash
RNNOISEPATH=$1
MICSOURCE=`pactl list sources short|grep input |awk '{print $2}'|head -1`
echo "Using ${MICSOURCE} as raw mic input. If you have multiple sound cards override the value for MICSOURCE in the script."
pacmd load-module module-null-sink sink_name=mic_denoised_out rate=48000
pacmd update-sink-proplist mic_denoised_out device.description='"Denoised Mic"'
pacmd update-source-proplist mic_denoised_out.monitor device.description='"Denoised Mic Monitor"'
pacmd load-module module-ladspa-sink sink_name=mic_raw_in sink_master=mic_denoised_out label=noise_suppressor_mono plugin=${RNNOISEPATH} control=50
pacmd load-module module-loopback source=${MICSOURCE} sink=mic_raw_in channels=2 source_dont_move=true sink_dont_move=true
pacmd load-module module-remap-source source_name=denoised master=mic_denoised_out.monitor channels=2
pacmd update-source-proplist denoised device.description='"Alt Denoised Mic Monitor"'
DivanX10 commented 1 year ago

Tell me how it should work? I did, I see that the microphone hears, but the virtual microphone Alt Denoised Mic Monitor does not hear

image image

If I use the module for echo cancellation, the noise is eliminated

#Used to perform acoustic echo cancellation between a designated sink and source
load-module module-echo-cancel source_name=alsa_input.platform-sound_0.seeed-8ch source_properties=device.description=MicrofoneNoise
set-default-source MicrofoneNoise

And how to use renoise to eliminate all backgrounds, music, extraneous sounds and so that only speech is heard?