home about me

Prevent changes to the input volume on MacOS

Many video call tools, like Google Hangouts, Microsoft Teams, Whereby, Around […] offer automatic gain control. But only some of those tools will let you disable it.

The Problem

Automatic gain control certainly is a nice thing to have. Its main purpose is to detect if your microphone is not loud enough, and amplify the gain.
Unfortunately, if you have a really sensitive microphone, your silence might be detected as not-loud-enough-speech, and the microphone input volume gets turned to maximum. Then, the next time you speak, the sound will be distorted and way too loud!

The Solution

The extension Disable Automatic Gain Control for Chrome seemed nice, but unfortunately will not work for Desktop applications, nor does it work reliably in all browser based tools.

Instead of trying to find even more clever ways of somehow detecting and then preventing gain changes, a simple Apple Script will fix this issue:

set initialInputVolume to input volume of (get volume settings)
repeat
	set volume input volume initialInputVolume
end repeat

Save this as a .scpt file, within the MacOS tool called Script Editor, and run it before you run whichever tool messes with your audio settings.
It will read the current input volume, and continually set it back to whatever it was when the script started, overriding any attempts of third party apps to change those settings.