I usually have music playing on my Mac while wearing earphones. And I often change the volume with my wired keyboard keys.

I imagine that it is an issue with the keyboard itself, but sometimes (rarely), when I increase the volume, despite the fact that I'm no longer pressing the keys, the volume still goes up to the max.

And of course, my earphones explode on me before I realise what's going on.

To solve this, rather than changing my volume-adjusting habits, I was wondering if there is some way to put a volume hard-limit in the system. Like, "whatever happens, don't let me go beyond 70%" or something.

OSX Mavericks.

3 Answers 3


If this problem is still relevant to you, I've got good news.

I wrote an app, which limits the volume on your Mac to a given percentage you set. It's called Earsafe, you can check it out at earsafe.io.

All the best!

  • Thanks for that. This 2020 MBP 13" (2 TB port version) has been maxing the volume of my bluetooth speaker when connecting sometimes. It's killed me four or five times over the last three weeks. My ears hurt right now. After playing with earsafe for a few minutes, I can tell it'll save my hearing with this dangerous computer. Feb 2, 2021 at 3:30

I do not know about the "Hard limit" but you can use the

sudo osascript -e "set Volume 10" 

for max

or sudo osascript -e "set Volume 5" 

for mid range

and so on.


It’s 2019 and sadly this is still relevant.

I was using Konstantin Anoshkin’s (now extinct) background daemon and I ended creating one myself that solved some things I did not like.

The script uses AppleScript and Javascript to create a slightly more complex app that you can close and that shows a notification and emit a “bip” when you exceed your volume limit.

class Volimiter {
  constructor(appName, maxVolume) {
    this.app = Application.currentApplication();
    this.app.includeStandardAdditions = true;
    this.appName = appName;
    this.maxVolume = maxVolume;

  get currentVolume() {
    const { outputVolume } = this.app.getVolumeSettings();
    return outputVolume;

  limitVolume() {
    if (this.currentVolume > this.maxVolume) {
      this.app.setVolume(null, { outputVolume: this.maxVolume });

  showNotification() {
    this.app.displayNotification("", {
      withTitle: this.appName,
      subtitle: `Limiting your 🎧 volume to ${
      }% to protect your ears`

const PurrfectVolume = new Volimiter("Purrfect volume 😸", 25);

function idle() {
  return 0.5;

You can set your desired maximum volume on the second parameter of Volimiter, on line 27. Just play with what it feels right.

To be able to go over the volume limit (i.e. you switch to speakers and want to watch a movie) you can quit the script/app from your task manager.

I wrote everything about it in this in [this blog post](https://medium.com/trabe/limiting-your-macs-volume-in-2019-f314e20408ab). You can ask as many questions as you like to adapt it to your needs.

I hope it helps people with this problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .