Tuesday 2 August 2022

ReplayGain Scan update

New release 0.4

ReplayGain Scan is now hosted on GitHub.

It also sports a new icon to match the Big Sur aesthetic.

For details, and to download the new release, go to GitHub.


Saturday 15 February 2020

ReplayGain Scan macOS Catalina support

I've finally updated the Replay Gain scan utility to be 64-bit, thanks to an update of the program I use to package and run the scripts (Platypus). It should now run fine on macOS Catalina 10.15, but I can't confirm that as I've yet to upgrade. (I don't want to lose my old 32-bit games—such a shame Apple wouldn't maintain compatibility.)

New icon too, with a Catalina-inspired palette:


Download Replay Gain Scan Release 0.3

Saturday 17 February 2018

ReplayGain Scan utility upgraded

I've updated the Replay Gain scan utility to use a newer version of metaflac (which performs the gain computation for FLAC files), in order to add support for higher sample and bitrate files. Also, there is a new icon more befitting of the current version of macOS.

Friday 1 June 2012

Fine-grained volume control on Macs

Mac keyboards have those volume keys which do the obvious thing. Holding down shift+option while using those keys changes the volume in smaller increments—quarter blocks instead of whole blocks.

This feature was in Snow Leopard (and maybe earlier), but was one of a long list of features inexplicably dropped in Lion. Well thanks to muscle-memory I discovered that it is back in as of Lion 10.7.4!

Saturday 23 July 2011

ReplayGain Scan Utility for Mac OS X

UPDATE: Now 64-bit, supporting Catalina. See this post for more details.

I like to use volume-adjusted playback on my Squeezebox Touch to make all albums have roughly the same volume level. I'd found a good script to scan all of my FLAC files and tag them with ReplayGain information, but AAC and MP3 files were a bit more of a pain, and scanning of new files was a bit laborious.

I've put together a utility that takes the chore out of all this. Simply drag folders  onto the icon and supported audio files (FLAC, MP3, AAC) are checked, and if there is no (consistent) Album Gain, it will be computed using the standard tools for the job (the official metaflac tool for FLAC files, and aacgain for AAC and MP3 files).

I'v tested this with my music collection of around 24,000 files (which are 75% FLAC, and the rest MP3 or AAC). Everything worked very well... the files that the scanner had problems with turned out to be corrupt in some way. It is not too time-consuming to rescan an already scanned hierarchy either, it just reports the gain and moves on.

Two versions are included: the standard version will skip already scanned files, and the "Full Rescan" version will ignore any previous values and recompute.

Squeezebox Server correctly reads all the gain information, as does my computer player, Clementine. Apple's iTunes has its own scheme, "Soundcheck".


I hope this will be useful to others. It is released under the GNU Public License Version 3. In particular:

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Latest version:



Old versions:


  •  0.1: Download (Zip archive containing app and instructions)
  •  0.2: Download




Wednesday 22 June 2011

Sound check, replay gain

Ever since the neighbours downstairs complained about my music being too loud, I've been a bit paranoid when listening to music. The trouble is that it's hard to know how loud it is, since everything is recorded at different levels. There is also the loudness war to contend with. Ideally, I want to know that if my stereo indicates (say) -45dB then this will not be too loud, regardless of the source material.

Replay gain is a (de-facto) standard where the source material's loudness is compared to a reference level and the playback volume adjusted to match that level. Determining loudness it is an expensive computation, so it is done in advance and the gain value is stored in the music file as a metadata tag. In fact there two gain values, one for the individual track, and one for the whole album. When listening to a complete album, especially classical music, the relative loudness between tracks should be preserved using the (same) album gain for all tracks. When listening to a mix of music, track gain might be better.

Luckily, my playback system (a Squeezebox Touch)  supports replay gain as long as the music files are appropriately tagged. Most of my music is encoded in the open source lossless format FLAC, and there are tools to add the gain information (e.g., metaflac on the command line, foobar2000 on Windows). I used metaflac with the aid of some shell scripts to update my music collection overnight. This leaves my MP3 and AAC files to scan, and I am still looking into the best way to do that on my Mac. I might use foobar2000 with emulation.

The Squeezebox Touch needs to be configured to use replay gain using the web UI (Settings > Player > Audio, choose one of the volume adjustment options). It all works very smoothly and really tones down the loud mixes. This is not at the expense of quality; volume adjustment is done linearly in a 24-bit domain. There is no loss of dynamic range when volume is reduced, and positive gain is restricted to prevent any clipping (using peak data which is also harvested during the replay gain scan).

Now that it is all done, the volume knob on the stereo is actually set a bit higher than usual, because almost all music has a negative gain. Ironically, early CD pressings (1980s) are closest to the reference level, while modern mastering, especially radio-friendly pop music, is very heavily compressed and fatiguing to listen to for long periods. A negative gain on these tracks doesn't make them sound any better, but at least saves reaching for the remote!

Tuesday 21 June 2011