Skip to content

Instantly share code, notes, and snippets.

@chrisallenlane
Created October 21, 2020 23:04
Show Gist options
  • Save chrisallenlane/9c4aab3354a7848e8fc0bb03810163a4 to your computer and use it in GitHub Desktop.
Save chrisallenlane/9c4aab3354a7848e8fc0bb03810163a4 to your computer and use it in GitHub Desktop.
PulseAudio: enable noise suppression on microphone
#!/bin/bash
# This creates a noise-suppressed monitor of the Yeti Nano
# see: https://unix.stackexchange.com/a/579680/44856
# see: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index45h3
##
# To view available sources:
# pactl list sources short
#
# example output:
# 0 alsa_output.usb-Blue_Microphones_Yeti_Nano_2034SG007ST8_888-000154040606-00.analog-stereo.monitor module-alsa-card.c s24le 2ch 44100Hz RUNNING
# 1 alsa_input.usb-Blue_Microphones_Yeti_Nano_2034SG007ST8_888-000154040606-00.analog-stereo module-alsa-card.c s24le 2ch 44100Hz RUNNING
# 2 alsa_output.pci-0000_0b_00.1.hdmi-stereo-extra1.monitor module-alsa-card.c s16le 2ch 44100Hz RUNNING
# 3 alsa_output.pci-0000_0d_00.4.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz RUNNING
#
#
# To view available sinks:
# pactl list sinks short
#
# example output:
# 0 alsa_output.usb-Blue_Microphones_Yeti_Nano_2034SG007ST8_888-000154040606-00.analog-stereo module-alsa-card.c s24le 2ch 44100Hz IDLE
# 1 alsa_output.pci-0000_0b_00.1.hdmi-stereo-extra1 module-alsa-card.c s16le 2ch 44100Hz IDLE
# 2 alsa_output.pci-0000_0d_00.4.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
##
# specify the audio source and sink
source_master="alsa_input.usb-Blue_Microphones_Yeti_Nano_2034SG007ST8_888-000154040606-00.analog-stereo"
sink_master="alsa_output.pci-0000_0d_00.4.analog-stereo"
# load the `module-echo-cancel` PulseAudio module
pactl load-module module-echo-cancel \
sink_name="echo_cancel" \
source_master="$source_master" \
sink_master="$sink_master" \
aec_method="webrtc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment