How to make Microsoft Teams use a virtual microphone
1
vote
0
answers
66
views
My goal is to alter my voice in a particular way and redirect it to MS Teams.
I managed to pipe my voice from my headphones microphone to a virtual microphone named
wh40k
like this: parec -d $PHYSICAL_MIC | sox $FILTERS | pacat -d $VIRTUAL_MIC
.
In detail, this is my code:
VIRTUAL_MIC="wh40k"
# Hard-coded headphones microphone name which I got from pactl list
PHYSICAL_MIC="alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Headphones__sink"
# Check for required software: quit if any not found
for CMD in parec sox pacat; do
if ! command -v "$CMD" &>/dev/null; then
echo "Error: $CMD not found.."
exit 1
fi
done
cleanup() {
echo "Removing virtual microphone $VIRTUAL_MIC..."
pactl unload-module "$MODULE_ID"
exit 0
}
if ! pactl list sinks short | grep -q "$VIRTUAL_MIC"; then
echo "Creating virtual microphone '$VIRTUAL_MIC'..."
MODULE_ID=$(pactl load-module module-null-sink \
sink_name=$VIRTUAL_MIC \
sink_properties=device.description="$VIRTUAL_MIC")
if [[ -z "$MODULE_ID" ]]; then
echo "Error: could not create virtual microphone '$VIRTUAL_MIC'."
exit 1
fi
else
echo "Virtual microphone '$VIRTUAL_MIC' already exists."
fi
trap cleanup INT TERM
echo -e "\nConfigurated sinks:"
pactl list sinks short
echo -e "\nConfigured sources (monitor):"
pactl list sources short
echo -e "\nConfiguring '$VIRTUAL_MIC' audio pipeline..."
# $PITCH and other filters below are vars like "pitch -750"
parec -d "$PHYSICAL_MIC" --raw --format=s16le --rate=44100 --channels=1 | \
sox -t raw -r 44100 -e signed -b 16 -c 1 - -t raw - \
$PITCH $OVERDRIVE $GAIN $REVERB $EQUALIZER $BASS $TREBLE $CHORUS $ECHO | \
pacat --raw --device="$VIRTUAL_MIC".monitor
I can confirm that parec | sox
works because I tested it with parec | sox | pacat
and sox
filters were correctly applied.
Now I can't use wh40k
virt mic on MS Teams: when I select MS Teams > Settings > Devices > Microphone: Monitor of wh40k
I can't hear my voice from the Teams test call.
Any clue on how could I troubleshoot this?
My versions:
- MS Teams 1.5.00.23861 (64-bit)
- Linux Mint 21 Kernel
- 6.8.0-40-generic
- pipewire 1.2.7
Asked by elmazzun
(169 rep)
Jan 2, 2025, 09:59 PM
Last activity: Jan 5, 2025, 01:21 PM
Last activity: Jan 5, 2025, 01:21 PM