Limiting Your Mac’s Headphone Volume

--

I wanted to limit the volume of my headphones to a certain a percentage; mostly do with making sure I still have my hearing intact in 10 years time.

Lucas Andión, luckily for me, has written an in-depth article on the perils of high volume and how to know if your headphone volume is too high. In his article is an AppleScript that can be used to reset the volume whenever it goes over a specified threshold.

One shortcoming of this script was that it would still force the volume to a certain level even when headphones are unplugged. I’ve slightly tweaked the script to limit the volume only if you have your headphones connected.

Head over to Lucas’s article for instructions on how to create an app from the script, but you can use the very slightly tweaked version below to check if headphones are plugged in.

To identify the currently plugged in audio device, SwitchAudioSource is used. You’ll need to have that installed. brew install switchaudio-osx should sort that out.

The script also makes an assumption that your headphones are identified as “External Headphones” in your Mac sound settings. Please update the script if it’s not.

Happy (safe) listening!

Photo by Francis Bouffard on Unsplash

--

--