Is it possible to put a hard limit on the sound volume? 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.
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!