by Buttons840 · 4y ago · 0 comments
*/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.
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/97945For 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
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.