This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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.
Added an option "--reference" in order to define the reference loudness (EBU R128: -23 LUFS).
Added an option "--db" in order to force dB as unit instead of LU/TP.
Added an option "--quiet" in order to suppress any writing to stdout.
Fixed loading "libsox.so.1".
Fixed overwriting of files.
The core library "lib1770" was restructured in order to avoid duplicated computations.
Scanning the EBU R128 test vector demonstrates that there is performance boost of about 40%
(without true peak computation).
The new "lib1770" now supports parallel computations. As demonstrated by the multithreaded
"example2" program compared to sequential "example1" program parallelism may give
another performance boost of about 50% (not yet used by R128GAIN).
Added "--ffmpeg" and "--sox" command line options in order to allow
for providing the path to the respective shared libraries.
Fixed missing the "TP", "TPDB", "AP", and "APDB" environment variables.
Added a CLI (command line) only version (i.e. without GUI.)
Provided Linux 64 bit builds.
Fixed crashing CLI on Windows XP.
Unicode/UTF16 support for Win32.
GTK2 and GTK3 GUIs for Linux.
GTK2 GUI for Win32.
No static buffers any longer.
75% rewrite (BS.1770 algorithm unchanged).
Added an option to the command line (--tags=[rg|bwf])
and the GUI (drop down box) for letting R128GAIN write
instead of ReplayGain tags. The following BWF tags are currently supported
(depending on the format they may appear converted to upper case):
Fixes a bug that under certain circumstances a file was written twice.
According to FFmpeg.org:
FFmpeg development has gone into OVERDRIVE. As a consequence R128GAIN
wasn't compiling any longer using the latest FFmpeg versions.
This release ports R128GAIN to the latest FFmpeg API.
Added a command line and GUI option to allow choosing between
the EBU R128-2 (current, dating from 2011) and EBU R128-1 (former, dating from 2010)
Decode using SoX and convert to MP3 by physically applying the track gain using
(very useful for creating MP3s to be used with your mobile MP3 player,
requires "lame.exe" to be copied into the subfolder "r128gain"):
Fixed a glitch regarding switching between the "command" and other output modes.
Set default gate to -10.0 LUFS and default block overlap to 75%
(according to the latest EBU R128 and BS1770-2 specifications.)
Avoid division by zero in LIB1770 (implies a slight API change.)
Further improved GUI synchronization.
Implemented some GUI synchronization with respect to the "command" feature.
Wrapped arguments in the "command" preset with double quotation marks (").
Extended number of lines in input list.
Distribute limited versions of "sox.exe" and "ffmpeg.exe" for usage
whithin the "command".
Implemented an alternate BS.1770 statistics using a histogram as
The histogram based statistics avoids memory overflow and appears
to improve performance. The new histogram based statistics is default.
The public API of lib1770 is changed slightly in order
to allow for choosing the statistcs algorithm, either histogram
Provided an option to execute a command in addition to the build-in actions
to be enabled via the "Format" drop down box.
The command's environment provides the following variables:
%PATH%: The systems's path extended by the sub-directory "r128gain".
%TRACK%: The complete path to the source track.
%NAME%: The name of the source track including the extension.
%BN%: The base name of the source track, i.e. excluding the extension.
%EXT%: The extension of the source track.
%DN%: The output directory.
%TG%: The track gain.
%TGDB%: The track gain in dB.
%TP%: The track peak.
%TPDB%: The track peak in dB.
%AG%: The album gain.
%AGDB%: The album gain in dB.
%AP%: The album peak.
%APDB%: The album peak in dB.
Allow choosing the BS.1770 block overlap by parameter partition (1, 2, 3, ...).
The corresponding overlap in % is (1 - 1/partition) * 100%.
Important: Requires "bumped"
"avutil-51.dll". For upgrading to the latest full FFmpeg build
get the respective DDLs from
Please note that FFmpeg's MP3 muxer (in "avformat-53.dll") now
calculates a XING header, i.e. MP3s
processed with R128GAIN now contain the correct length information.
R128GAIN supports a variety of configuration options:
Of course, EBU 128 mode is the default:
It uses the gated BS.1770 algorithm.
It determines peaks at 4 x up-sampled rate (True Peak).
It writes tags with respect to -23 LUFS (compatible with EBU 128).
Instead you may choose ReplayGain compliance:
It uses the classic "gain_analysis.c" as it is found e.g.
in WaveGain and as it is re-distributed with the WA SDK.
Peaks are determined without up-sampling (no "True Peak")
as required by Notat.
Tags are written according to the RG standard (i.e. just as
calculated by "gain_analysis.c" without any alteration).
Finally you may choose your own profile. The following seems
to be the most wanted:
You may choose the BS.1770 algorithm.
You may choose "True Peak" (i.e. up-sampling for peak determination).
You may choose "Loudness Range".
You may choose to write the tags RG compatible (i.e. with
respect to -18 LUFS).
You may fine tune the -18 LUFS.
In order to get an idea how to fine tune the -18 LUFS you
may first run a linear regression between RG and BS.1770.
Converting to FLAC.
You may choose to tag the files in place (please be very careful
with this option, if something's going wrong your files may be lost
FFmpeg based I/O.
Comes with minimal FFmpeg (supporting only a restricted set of
"open" codecs, e.g. WAV, FLAC, OGG/Vorbis).
In order to upgrade to full FFmpeg support (i.e. to all FFmpeg
supported formats and codecs, unfortunately not including Wavpack)
do the following:
Google for "ffmpeg autobuild".
Pick the latest W32 shared build and substitute the corresponding
DLLs in R128GAIN's sub-directory "r128gain".
Command line syntax:
$ r128gain --help
An EBU R128 (http://tech.ebu.ch/loudness) compliant loudness scanner.
For details refer to "http://r128gain.sourceforge.net/".
Usage: r128gain [options] (file|directory)+ [-o <directory> [flac|mkv]]
--r128 Run in EBU R128-2011 compliance mode (default).
--r128-2011 Run in EBU R128-2011 compliance mode (default).
--r128-2010 Run in EBU R128-2010 compliance mode.
--a85 Run in ATSC A/85:2011 compliance mode.
--a85-2011 Run in ATSC A/85:2011 compliance mode.
--rg2 Run in ReplayGain2 compliance mode.
--rg Run in ReplayGain compliance mode.
--reference=<float> Set reference loudness in LUFS.
--r128-compatible Calibrate output according to EBU R128.
--rg-compatible Calibrate output according to ReplayGain.
--db Use dB as unit rather then LU/TP.
--partition=<int> BS.1770 overlap
(overlap in % = (1 - 1/partition) * 100%,
default: 4, i.e. 75% overlap).
--gate=<float> BS.1770 gate (-10.0 .. -8.0, default: -10.0).
--rg-calibration=<float> Aequivalent to use for ReplayGain
loudness (default: -18.0).
--range=on,--range Calculate loudness range (default).
--range=off,--no range Don't calculate loudness range.
--tags=[rg|bwf] Write ReplayGain (default) or BWF tags.
--fast Switch off up-sampling and don't calculate
--mono=off Treat mono as stereo (default).
--mono=on,--mono Don't treat mono as stereo.
--quiet Supress output to stdout.
--progress=on Display progress (default).
--progress=off Don't display progress.
--traditional Format output traditionally.
--command=<string> Run command on each track.
--overwrite Overwrite already existing output files.
--in-place Overwrite original files.
--loglevel=<integer> Set FFmpeg loglevel.
--regression Calculate linear regression between EBU R128
--duration Print out duration.
--version Display version information.
--ffmpeg=<path> Directory of the FFmpeg shared libraries.
--sox=<path> Directory of the SoX shared libraries.
--help Display this information.