Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    */5 * * * * osascript -e 'set volume output volume (output volume of (get volume settings))-1'
Speaking of tinnitus, and since this is Hacker News: I've entered the above in crontab (crontab -e) on my mac. It lowers the volume a small amount every 5 minutes. I have to press the volume up button once every 30 minutes to keep a roughly equal volume level.

This prevents me from accidentally listening to something that is too loud for too long. At the level I usually listen to music, it takes about 2 hours to fade to nothing; it's a linear fade, so after 30 minutes the volume is at 75% my preferred starting volume. If I get lost in my work, the music gradually fades and I avoid realizing many hours later that I've been blasting my ears the whole time.

I wish all devices had a mode like this. I haven't investigated how to do this on Linux, but it should be possible there as well I think.



Thought this was interesting so had a quick search and here is what I found

For linux there are a few solutions depending on the install:

    */5 * * * * pactl set-sink-volume @DEFAULT_SINK@ -2%
or with amixer

    */5 * * * * amixer -D pulse sset Master 2%-
Terminal command to set audio volume? - https://askubuntu.com/a/97945

For windows you can use powershell to trigger the Volume Down Button

    $obj = new-object -com wscript.shell
    $obj.SendKeys([char]174)
Simply add the script to a Task scheduler task (create as a daily task then go into advanced and trigger every x minutes)

Change audio level from powershell - https://stackoverflow.com/a/21362870 Run a task every x-minutes - https://stackoverflow.com/a/4250516


Thanks for this. Really great idea! I normally don't set my headphones that loud but it's happened that I raised the volume during a meeting because someone was talking too quietly and forgot to lower it.


Another nice bonus is that if you're listening to a song at room filling volume during the day, and then later at night you want to quietly watch a video, by then the volume will have decayed to zero so you wont be surprised with a really loud video.


seems like it'd be better served to have some sort of limit on how loud the volume on a device can be set. maybe in the system preferences set MAX = 75%, but in Finder allow the volume to be set at 100% in the UI but the system keeping it limited. make this a per Output setting so when you switch back to Built-in or other external device it is not limited to anything but your buds.


The issue is while your system volume can be the same, media volume varies immensely. Listening to one album, it could be all relatively low and gentle. The next one could be noise that blasts your ears but you don't really think about it due to focusing on something else.

Sometimes I'll try adjusting my volume down to half and notice everything still sounds fine. It's a sign that I was listening to something way too loud without even realizing it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: