aacgain is a modification to Glen Sawyer's excellent
mp3gain program. It supports AAC (mp4/m4a/QuickTime) audio files in
addtion to mp3 files. If you are not familiar with mp3gain, stop reading this,
and go to http://mp3gain.sourceforge.net.
aacgain normalizes the volume of digital music files using the
Replay Gain algorithm. It works by modifying the global_gain fields in
the aac samples. Free-form metadata tags are added to the file to save undo
information, making the normalization process reversable.
aacgain uses the same command-line user interface as mp3gain, and is compatible
with the mp3gain Visual Basic GUI.
It also integrates with iTunes using my iGain GUI.
BACK UP YOUR MUSIC FILES BEFORE USING AACGAIN! UNLIKE MP3GAIN, AACGAIN IS
NOT COMPLETELY REVERSABLE. THE UNDO OPTION IS INTENDED TO RESTORE A MUSIC
FILE TO BE FUNCTIONALLY EQUIVALENT TO ITS ORIGINAL STATE, BUT IT WILL NOT
BE BIT-FOR-BIT IDENTICAL TO THE ORIGINAL FILE. IT IS POSSIBLE FOR APPLE
TO CHANGE THE ITUNES MUSIC FILE FORMAT IN WAYS THAT ARE INCOMPATIBLE
WITH AACGAIN, RESULTING TO CORRUPTED MUSIC FILES THAT CANNOT BE RESTORED
TO THEIR ORIGINAL STATE. I AM NOT RESPONSIBLE FOR DAMAGED FILES.
aacgain was implemented using
to parse mp4 files, and to read and write metadata, and
decode the audio samples.
aacgain is released under the GPL V2
license. I distribute AACGain in source code form only
to avoid any MPEG royalty issues, and
to ensure that users have the knowledge to fix whatever bugs they find
Source code can be found in the mp3gain cvs repository
on Sourceforge. The module name is aacgain.
A compiled binary for Microsoft Windows® is hosted at
Pre-built Unix packages are available for
Mac OS X,
What's new in Version 1.9
Fixed a bug in mp4v2 which caused iTunes music video files
to fail with "not a valid mp4/m4a file" error.
Gives a more meaningful error message when attempting to
process Apple Lossless files.
Built with updated mp4v2 from Google Code, which should build
error-free on modern Windows, Mac and Linux systems.
Built with updated faad2 code, which should build error-free
on modern Windows, Mac and Linux systems.
Built with latest mp3gain version 1.5.2 source checked into CVS,
which includes id3v2 tag support.
MSVC++ solution and project files have been converted to Visual
C++ 2010 Express Edition.
Version 1.8 fixed the following issues:
- Built with mpeg4ip/mp4v2 version 1.6.1. Aacgain 1.7.1 was built with
version 1.5.20. Mp4v2 version 1.6.1 corrects problems that corrupted
video files containing Quicktime chapter markers.
- Built with latest mp3gain version 1.4.7 sources checked into CVS.
The mp3gain changes made since 1.7.1 support sample rates up to 96000.
Previous versions had a maxmimum sample rate of 48000.
- Ignores faad2 "scalefactor out of range" errors. These errors resulted
in "invalid file format" errors on apparently good files.
Version 1.7.1 fixed the following issue:
- MSVC++ solution and project files have been converted to Visual
C++ 2005 Express Edition. Other than the version number, no other
source code changes have been made.
Version 1.7 fixed the following issue:
If the total length of the directory plus file name path exceeded 64 bytes,
memory corruption would occur. This has been corrected.
Version 1.6 fixed the following issue:
Files with a 'cprt' (copyright) tag are now processed correctly. Previous
versions of aacgain corrupted the metadata of files with a copyright tag.
AACGain now works on video or other files where the first audio track has a
track number of other than 1. Previous versions required the audio track to
have a number of 1. AACGain will still only process the first audio track found
on a file. Thanks to Arthur Yarwood at Sony Computer Entertainment Europe for
Version 1.5 fixed the following issue:
Running AACGain on Apple lossless or other unsupported file format resulted in
a crash with an unhandled exception.
Version 1.4 fixed the following issues:
Temporary files are created in the same directory as the input file. Formerly
they were created in the same directory that the program was run in. This
solves a problem only seen on Unix systems where the temporary file could not
be renamed back to the original input filename, if the input file was located
on a different filesystem from where the program was run. Windows users are
unaffected by this problem and can continue to use 1.3.
Version 1.3 fixed the following issues:
Always uses the /t (use temp file) option, even if it is not specified on the
command line. This resolves issues where processed files would not play on the
Preserves original values of MP4 properties bufferSizeDB, maxBitrate and
avgBitrate. Without this change, mpeg4ip/mp4vs was recalulating the actual
values of these parameters. This caused bitrate as displayed by iTunes to
change slightly, i.e. songs ripped at 320KB would display as 319KB.
Incorporates recent changes to mp3gain which prevent crashes when working with
48KB files on Linux.
Source code directory structure was reorganized to be compatible with mp3gain
CVS on sourceforge. Thanks to Glen Sawyer, the AACGain source code is now
hosted on sourceforge's CVS repository as part of the mp3gain project.
Version 1.2 fixed the following issues:
Compatibility issue with MP3GainGUI version 1.2.5 or 1.3.4.
All temporary files created are erased.
Version 1.1 fixed the following issues:
Multi-channel and mono files now work.
Fixes compatibility issues with MP3GainGUI: the /o option always outputs Album
The /f option is ignored for AAC files. If a file starts with a 'ftyp' atom, it
is assumed to be AAC, even if /f was specified. This prevents the /f option
from corrupting valid AAC files.
Uses portable versions of all library functions, and has been successfully
compiled under Linux. Thanks to Prakash Punoor for his help with this.
Thanks to Glen Sawyer, source code for AACGain is hosted in the
sourceforge cvs repository as part of the
mp3gain project, in the
Contact me if you want to contribute
to aacgain's development.
As of aacgain version 1.9, I have access to Linux and Mac systems, and I am now supporting the Linux build
environment originally developed by Prakash Punnoor. See the source code "linux" subdirectory
for details. The file "unix_build_system.tar.bz2" remains in the CVS repository for historical
reasons, but is not being maintained, and is not compatible with the current source code.