Hacker News new | ask | show | jobs
by jjd33 2047 days ago
I needed this so badly in my life. I use mpv even for music this is a godsend.
2 comments

I'm unfamilar with this tech, but I think I need this badly in my life. Care to explain a little about what you'd use this for?

I think I need this because I listen over headphones to audio that changes volume levels (eg. Spotify playlists with a variety of artists) in a somewhat noisy office environment (I can't just listen more carefully when the music is quiet) but don't want to turn the volume up too high. I also don't want to have to be constantly reaching for a volume slider. Currently, I am constantly reaching for a volume slider, because some song comes on that's loud and I have to turn it down, then a quiet song comes on and I forget to turn it back up, and eventually I notice I'm distractedly listening to conversations from sales instead of focusing on my tasks and drowning them out with background music. And heaven help you if you have a source of audio with ads (eg. Pandora or Youtube playlists), where every half hour you'll get your eardrums blown out with some obnoxiously loud ad break.

My uneducated expectation is that this would run in the background on my Linux laptop, letting the volume decay in between beats and as the song switches, but amplifying quiet songs and compressing loud ones. It would be nice if some of the dynamic range of a song was preserved, but instead all songs should go from, to use the musical terms, mezzo-pianno to mezzo-forte. I don't particularly care if it has to buffer the next 10 seconds of the song to make that work, but as I like to stream a variety I can't wait for it to compress a full hour of audio.

Is that what this does? Do I need to use mpv, or have a local/offline mp3? Is there a better way to do what I want?

Didn't read the article but I'm almost certain it's dynamic range compression.

I don't know why this hasn't been standard in Every OS.

EDIT: NOPE! It's just an automatic gain control :/

Dynamic range compression is kind of the same thing as automatic gain control (well, automatic gain control is one way of describing how to implement dyanmic range compression). This github project implements a compressor, it says in the readme.
Spotify includes loudness correction in it’s preferences. It will compare the LUFS loudness of all songs and turn down the loud ones to match -14 LUFS.

It works as expected on my phone, although I notice it is off on my desktop app, despite it being activated in my preferences. A bug.

Sennheiser headphones with ALC might help - they do a pretty good job for me in evening out volume levels.
I think you might be able to accomplish this in mpv using --lavfi-complex and the apprpriate ffmpeg filters.. alimiter maybe?