Windows – losslessly increase the volume of an MP3 file

audiomp3windows

I want to increase the volume of some MP3 files that I have. Is there a way to do this in a lossless way (without re-compressing the MP3 file and hence decreasing its quality)?

Best Answer

Yes. You can do this. The technique is used by a number of programs and the levels are calculated by an algorithm called ReplayGain. Mp3 volume level data can be adjusted losslessly, just as a JPEG picture can be losslessly rotated.

There are two methods

  1. Calculate the volume level of the file and add a new tag, letting compatible programs adjust volume on the fly
  2. Calculate the volume level and adjust a multiplier level in the mp3 data.

From HydrogenAudio: Implementations:

In the metadata method, information on both types of ReplayGain (Track Gain and Album Gain) can be stored. The volume-change information can be very precise. If audio data was also changed, the metadata can contain "undo" info. Not all audio players/decoders know how to read and use ReplayGain information stored in metadata. And there's no standard for where and how ReplayGain info is stored; each implementation uses different formats and puts the info in different locations.

In the audio data method, the file's actual audio data is modified so that its natural/default playback volume is at the target level. In this scenario, only one type of ReplayGain (Track Gain or Album Gain) can be applied. If no "undo" info is saved somewhere, it may not be possible to restore the original audio data. Limitations of the audio file format may prevent precise (finely tuned) gain adjustments with this method. For example, MP3 and AAC files can only be losslessly modified in 1.5 dB steps. Depending on the audio file format, the process may also be lossy in the sense that it could irreversibly push a signal above the format's maximum amplitude (resulting in clipping) or below the minimum (resulting in silence).

The second method does alter your file, but because the underlying data is not modified it loses no quality, hence the adjustment can be done losslessly. It is not generally recommended for your main collection as it is modifying the files from their original state, but it can be very useful for portable media players.

A program called mp3gain can do the second option and reversibly adjust the volume of mp3s. It does absolutely no re-encoding and simply adjusts magnitude values in the mp3 file itself to change the volume. From HydrogenAudio: ReplayGain

If modifying the gain, it always modifies the global gain fields in the MP3 audio data. It can add somewhat precise metadata, including undo info

Due to the way mp3 files are encoded the adjustment is limited to 1.5dB steps, which is usually enough to get close.

Foobar2k also includes this functionality and can apply the changes to the files.