Skip to content

Instantly share code, notes, and snippets.

@osolmaz
Created March 24, 2020 14:50
Show Gist options
  • Save osolmaz/ec371a2359c8bb9dee955d545a1df753 to your computer and use it in GitHub Desktop.
Save osolmaz/ec371a2359c8bb9dee955d545a1df753 to your computer and use it in GitHub Desktop.
Bash script to adjust Zoom meeting microphone and speaker volume to normal levels
#!/bin/sh
LANGUAGE="en_US"
app_name="ZOOM VoiceEngine"
current_sink_num=''
sink_num_check=''
app_name_check=''
pactl list sink-inputs |while read line; do \
sink_num_check=$(echo "$line" |sed -rn 's/^Sink Input #(.*)/\1/p')
if [ "$sink_num_check" != "" ]; then
current_sink_num="$sink_num_check"
else
app_name_check=$(echo "$line" \
|sed -rn 's/application.name = "([^"]*)"/\1/p')
if [ "$app_name_check" = "$app_name" ]; then
echo "$current_sink_num" "$app_name_check"
pactl set-sink-input-volume "$current_sink_num" 50%
fi
fi
done
current_source_num=''
source_num_check=''
app_name_check=''
pactl list source-outputs |while read line; do \
source_num_check=$(echo "$line" |sed -rn 's/^Source Output #(.*)/\1/p')
if [ "$source_num_check" != "" ]; then
current_source_num="$source_num_check"
else
app_name_check=$(echo "$line" \
|sed -rn 's/application.name = "([^"]*)"/\1/p')
if [ "$app_name_check" = "$app_name" ]; then
echo "$current_source_num" "$app_name_check"
pactl set-source-output-volume "$current_source_num" 100%
fi
fi
done
@osolmaz
Copy link
Author

osolmaz commented Mar 24, 2020

This is because Zoom auto-adjusts when a new meeting starts, and it's annoying to change it back manually

@soonwookwon
Copy link

Thanks for the script! By the way, "Zoom VoiceEngine" keeps on resetting to 31% when I switch windows while in a meeting. If I want to use this script to fix this issue, how would I do so? Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment