Comment by AndyKelley

Comment by AndyKelley a day ago

4 replies

Because in order to get the best dynamic range while listening to diverse music, you need to detect the loudness of tracks and albums and adjust the gain of each track/album accordingly. In order to have room for the music player to adjust the volume higher for quieter tracks, you need to apply a "pregain" to lower the volume overall, while turning up your speakers to compensate. This solves the problem, but by doing this, your music player will generally have a lower volume relative to all other applications on the system, meaning that it generally will be desirable to turn down application-specific volume knobs accordingly.

More information: https://www.youtube.com/watch?v=iuEtQqC-Sqo

pixelpoet 21 hours ago

I'm a bit star-struck to have you reply to my somewhat offhand comment, am aware of your audio player work and really want to be a Zig convert (just missing those vec3 and complex operators, having equal mathematical standing to ints and floats) and your original Zig intro video is IMO one of the best tech presentations of all time, but I digress...

I'm aware of ReplayGain and this processing is important for per-track overall gain, but what I'm getting at is lower level: instead of there being two lossy/rounded stages of dimming and amplification, you want to communicate to the OS a log2 "dimming factor", so that this can be subtracted from a later log2 amplification factor such that we ideally waste no processing time if the sum is zero, and otherwise don't suffer the twice-quantised signal degradation (at most one accurate scaling pass, instead of two arbitrarily precision-reducing ones). It's maybe a minor point / imperceptible as others have noted, but IMO this seems like the Correct (TM) approach.

brudgers 20 hours ago

Why not use a compressor?

  • miunau 15 hours ago

    Compressors destroy dynamic range. The idea is to normalize, not limit.

    • brudgers 7 hours ago

      Compressors can manage dynamics.

      When properly understood.

      And provide a consistent interface for managing.

      When thoughtfully placed in a signal chain.