View Issue Details

IDProjectCategoryView StatusLast Update
0000712OpenMPTFeature Requestpublic2016-03-18 20:54
Reporterarseniiv Assigned To 
Status confirmedResolutionsuspended 
Product VersionOpenMPT / libopenmpt 0.2-beta14 (upgrade first) 
Summary0000712: Export: ReplayGain / R128Gain support

Could libraries used by OpenMPT set ReplayGain info, if it’s applicable, at least in some of export formats available now? In this case, could OpenMPT use that features and set up ReplayGain on export someday? :)


TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)




2015-09-30 10:48

administrator   ~0002150

It would be possible, of course.
In my opinion, it is (currently) not worth the effort (requires at least 2 additional 3rd party libraries for ReplayGain and R128Gain) for very little gain (and gain the lies outside the main purpose or goals of OpenMPT).
Furthermore, gain tags are mostly useful in context of multiple files with relative volume requirements (i.e. albums or compilations and album gain). For single files, it can easily be calculated by any player or tool after the fact.

Saga Musix

Saga Musix

2015-09-30 21:12

administrator   ~0002152

To add to that, the canonical ReplayGain implementation is released under the LGPL, which would require it to be linked as yet another DLL to OpenMPT, complicating building, packaging and distributing things more than necessary for such little gain (or alternatively reimplementing the algorithm under a different license, which I'm not too fond of as well).

Saga Musix

Saga Musix

2015-09-30 21:14

administrator   ~0002153

By the way, I think I spotted the canonical ReplayGain implementation in the LAME source as well, so maybe it can be enabled for libmp3lame exports at least? I didn't check this fact too thoroughly though, so it might be misleading.



2015-10-02 19:38

reporter   ~0002155

Interesting info, thanks! Well, I intentionally marked this request as low-priority at the start. :)



2015-10-07 11:59

administrator   ~0002157

Last edited: 2015-10-07 14:11

View 3 revisions

Yes, libmp3lame contains a ReplayGain implementation and we can use it. libmp3lame will unconditionally write the replay gain values to the VBR/Lame info header when enabled.
As I gather from , and , this appears to not be the most common way to store ReplayGain information in MP3.
libmp3lame also allows to retrieve the replay gain values which would allow us to additionally store them in the ID3v2 tag.
However, I have no personal experience with ReplayGain in practice, so I am not sure which method would be the most appropriate way to store it for OpenMPT. Hydrogenaudio lists at least 4 possible mehods:

  1. VBR/Lame info header: As far as I can tell, this cannot be avoided when using the libmp3lame implementation to calculate ReplayGain.
  2. ID3v2 RGAD frame: Hydrogenaudio documents this format as legacy. It is not specified in either ID3v2.3 or ID3v2.4 natively.
  3. ID3v2 RVA2 frame: This is specified by the ID3v2.4 specification. However, Hydrogenaudio also documents this format as legacy.
  4. ID3v2 TXXX frame with REPLAYGAIN_* metadata keys: This stores replay gain information in free-form text frames inside the ID3v2 tag. This does not violate ID3v2 spec (uses a defined frame type) and looks like the recommended (by Hydrogenaudio) way to store ReplayGain in ID3v2.


2015-10-07 14:11

administrator   ~0002158

  1. ID3v2 XRVA frame: The same as ID3v2.4 RVA2 frame, but named(?) properly(?) for ID3v2.3 compatibility.


2015-10-08 13:45

administrator   ~0002159

OpenMPT will now write out ReplayGain information when exporting via libmp3lame to MP3 VBR format by default (methods 1 and 4 listed above).
You can also get ReplayGain information when using libmp3lame and MP3 CBR format if you set [Export]MP3LameAllowID3v2inCBR=1 (method 4).
There are a couple of other ReplayGain related options listed at .



2015-10-11 08:53

administrator   ~0002160

and it looks like I had missed yet another possible method of storing ReplayGain in MP3:

  1. APEv2 tag with REPLAYGAIN_* metadata keys.

Issue History

Date Modified Username Field Change
2015-09-29 15:39 arseniiv New Issue
2015-09-30 10:48 manx Note Added: 0002150
2015-09-30 10:50 manx Assigned To => manx
2015-09-30 10:50 manx Priority low => none
2015-09-30 10:50 manx Status new => confirmed
2015-09-30 10:50 manx Resolution open => suspended
2015-09-30 10:50 manx Summary ReplayGain set on export => Export: ReplayGain / R128Gain support
2015-09-30 21:12 Saga Musix Note Added: 0002152
2015-09-30 21:14 Saga Musix Note Added: 0002153
2015-10-02 19:38 arseniiv Note Added: 0002155
2015-10-07 11:59 manx Note Added: 0002157
2015-10-07 12:00 manx Note Edited: 0002157 View Revisions
2015-10-07 14:11 manx Note Added: 0002158
2015-10-07 14:11 manx Note Edited: 0002157 View Revisions
2015-10-08 13:45 manx Note Added: 0002159
2015-10-11 08:53 manx Note Added: 0002160
2016-03-18 15:39 manx Assigned To manx =>