summaryrefslogtreecommitdiffstats
path: root/.config/pipewire/pipewire-pulse.sh
blob: bbcfa4892245a1797298433d8b31d36d710bd265 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

sleep 3

source_name="master-mono"
source_position=1

if [ "$(cat /etc/hostname)" = "work-01" ]; then
	source_position=2
fi

source_index=$(pactl list short sources |
	grep "input.*pci-" |
	head -n 1 |
	head -n "${source_position}" |
	awk '{print $1;}')

echo "${source_index}"

pactl load-module module-echo-cancel \
	"source_name=${source_name}" \
	"master=${source_index}" \
	use_master_format=1 \
	aec_method="webrtc" \
	aec_args='"beamforming=1 mic_geometry=-0.04,0,0,0.04,0,0"'

pactl set-default-source "${source_name}"
remember that computers suck.