# Replaygain Track Peak in dB

**URL:** https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892
**Category:** Support
**Created:** [August 24, 2023, 9:59am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892 "2023-08-24T09:59:42Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![AnnieBody1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AnnieBody1](https://community.mp3tag.de/u/AnnieBody1)
#### Post date: [August 24, 2023, 9:59am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/1 "2023-08-24T09:59:42Z")

</div>

Title says it all really.  
I want to display the REPLAYGAIN\_TRACK\_PEAK in db similar to the REPLAYGAIN\_TRACK\_GAIN.  
The gain automatically shows in db, but not the peak. I have changed Foobar to display both in dB (for no better reason than I prefer it that way) and want the same values displayed in MP3Tag.  
Is there a simple solution to convert the display to db?  
regards and thanks

BTW great product; I no longer use Zoltam despite having paid for a lifetime license!

---

<div class="post-metadata">

### Author: ![AnnieBody1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AnnieBody1](https://community.mp3tag.de/u/AnnieBody1)
#### Post date: [October 25, 2023, 10:47pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/2 "2023-10-25T22:47:19Z")

</div>

So, no one knows how to do this?

---

<div class="post-metadata">

### Author: ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)
#### Post date: [October 26, 2023, 5:23am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/3 "2023-10-26T05:23:25Z")

</div>

There is no way to do this in a logical way.  
See [here](https://wiki.hydrogenaud.io/index.php?title=ReplayGain_1.0_specification#ID3v2).  
"Peak level is a dimensionless quantity with 1.000000 representing full scale. No suffix is included on peak values."

---

<div class="post-metadata">

### Author: ![AnnieBody1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AnnieBody1](https://community.mp3tag.de/u/AnnieBody1)
#### Post date: [October 26, 2023, 10:49am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/4 "2023-10-26T10:49:44Z")

</div>

Then how does Foobar manage to produce the value?  
Surely this requires a formula; I just want to know how to apply it.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [October 26, 2023, 11:30am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/5 "2023-10-26T11:30:47Z")

</div>

This is what the [Foobar wiki](https://wiki.hydrogenaud.io/index.php?title=ReplayGain) says about the peaks:

- `REPLAYGAIN_TRACK_PEAK #.###### dB` - The value is always 8 characters including the decimal point. Example: `0.149923`
- `REPLAYGAIN_ALBUM_PEAK #.###### dB` - The value is always 8 characters including the decimal point. Optional.

So, if you see the decimal number ranging vom 0 to 1 in MP3tag, then you can easily add a "db" at the end of the value definition for the column. But is that really of benefit?

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [October 26, 2023, 11:32am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/6 "2023-10-26T11:32:51Z")

</div>

Have you asked the Foobar developers this? None of the Replaygain components are calculated by mp3tag, it is merely displayed as it is within the tag header fields.

---

<div class="post-metadata">

### Author: ![AnnieBody1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AnnieBody1](https://community.mp3tag.de/u/AnnieBody1)
#### Post date: [October 26, 2023, 12:16pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/7 "2023-10-26T12:16:45Z")

</div>

I think you are missing the point of my enquiry and that is how to get MP3Tag to calculate and display that calculation.  
MP3Tag  
 ![replay #2](https://community.mp3tag.de/uploads/default/original/2X/3/3fb6f0256671ae74b388a3eedf7b9a86b17e4a55.jpeg)  
vs  
Foobar  
 ![replay #1](https://community.mp3tag.de/uploads/default/original/2X/8/82fa350a9144323a0f94c23f3bb8bc25a79324ce.jpeg)  
In Foobar dB is a calculation of the track value as is track peak.  
So, as MP3Tag does this calculation for track value automatically how do I go about applying a calculation the track peak value and displaying the result.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [October 26, 2023, 12:33pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/8 "2023-10-26T12:33:52Z")

</div>

> [@AnnieBody1](#):
>
> display that calculation.

See the documentation on available mathematical functions:

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/#arithmetic-functions)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![AnnieBody1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AnnieBody1](https://community.mp3tag.de/u/AnnieBody1)
#### Post date: [October 26, 2023, 6:58pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/9 "2023-10-26T18:58:10Z")

</div>

Thanks.  
I have trawled through the information provided and in the absence of the obvious found a way to edit the displayed field:  
Customise Columns | Change Field | Functions  
As my first check to see what was going on I used 'right(x,n)' and used the formula right(%ReplayGain\_Track\_Peak%,2)  
This gave me a revised two character field, so good start!  
But when I changed the file back to %ReplayGain\_Track\_Peak% the original gain value is no longer displayed, instead it remains as two characters. I then created a second column with a different name but the same value %ReplayGain\_Track\_Peak% and I get the same truncated two characters!  
 ![Track Peak](https://community.mp3tag.de/uploads/default/original/2X/e/e495393dc9346ba701f330f7e0aff7fe58e241a1.jpeg)  
So, how do I get the correct original value back?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [October 26, 2023, 7:08pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/10 "2023-10-26T19:08:58Z")

</div>

> [@AnnieBody1](#):
>
> So, how do I get the correct original value back?

I would think: the backup

---

<div class="post-metadata">

### Author: ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)
#### Post date: [October 27, 2023, 6:41pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/11 "2023-10-27T18:41:31Z")

</div>

> [@AnnieBody1](#):
>
> So, as MP3Tag does this calculation for track value automatically how do I go about applying a calculation the track peak value and displaying the result.

Mp3tag does **not** do this calculation for track value automatically.  
Mp3tag may report and display Replay Gain values but it does not analyze audio data to calculate track value or any other value associated with Replay Gain.  
Replay Gain is metadata, and Mp3tag can edit it, but that is done by user input and not by analyzing the audio payload.  
Even if you knew a formula to make the calculations, it would normally require knowledge of the audio waveform and that is not available via Mp3tag.

---

<div class="post-metadata">

### Author: ![AnnieBody1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AnnieBody1](https://community.mp3tag.de/u/AnnieBody1)
#### Post date: [November 12, 2023, 5:06pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/12 "2023-11-12T17:06:02Z")

</div>

The formula would require a log function. Does MP3Tag have this available?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 12, 2023, 5:42pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/13 "2023-11-12T17:42:54Z")

</div>

This question should have been answered in this post of this thread:

> [@Replaygain Track Peak in dB](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/8):
>
> See the documentation on available mathematical functions:

---

<div class="post-metadata">

### Author: ![AnnieBody1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AnnieBody1](https://community.mp3tag.de/u/AnnieBody1)
#### Post date: [November 13, 2023, 11:53am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/14 "2023-11-13T11:53:13Z")

</div>

There is no log function listed in the standard mathematical calculations, however I believe MP3Tag must use log in order to calculate and display other dB values. It would appear to be an omission that needs adding.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 13, 2023, 12:26pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/15 "2023-11-13T12:26:41Z")

</div>

Please read this post, it has all the information:

> [@Replaygain Track Peak in dB](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/11):
>
> Mp3tag does not do this calculation for track value automatically. Mp3tag may report and display Replay Gain values but it does not analyze audio data to calculate track value or any other value associated with Replay Gain. Replay Gain is metadata, and Mp3tag can edit it, but that is done by user input and not by analyzing the audio payload. Even if you knew a formula to make the calculations, it would normally require knowledge of the audio waveform and that is not available via Mp3tag.

Mp3tag doesn't calculate any replaygain values, but simply displays what's available via metadata.

---

<div class="post-metadata">

### Author: ![mb2007](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mb2007/32/22590_2.png) [@mb2007](https://community.mp3tag.de/u/mb2007)
#### Post date: [April 5, 2024, 2:50am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/16 "2024-04-05T02:50:20Z")

</div>

Just FYI

The formula to convert a given track peak value to dB is purely mathematical, not requiring special knowledge of the waveform.

Before foobar2000 1.4.1 introduced `%replaygain_track_peak_db%` to automatically do the conversion, a fairly precise method of calculating the dB with foobar2000's scripting functions [was posted by HydrogenAudio forum user Axon](https://hydrogenaud.io/index.php/topic,82439.0.html). Log functions weren't strictly necessary; they were approximated.

Porting this to use in a custom column in Mp3tag may be possible, but without the ability to save and recall variables, it will be painfully long.

---

<div class="post-metadata">

### Author: ![AreDigg](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/bbe5ce/32.png) [@AreDigg](https://community.mp3tag.de/u/AreDigg)
#### Post date: [April 5, 2024, 9:01am UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/17 "2024-04-05T09:01:38Z")

</div>

> [@mb2007](#):
>
> The formula to convert a given track peak value to dB is purely mathematical, not requiring special knowledge of the waveform.

While it is a simple mathematical function taking the perceived peak value as a parameter, but peak value is a function of the waveform.

There is no magic going on, but you have to analyse the waveform in the frequency domain to find the loudest point compensating for the frequency response of a typical human ear.

If you have the linear value of the difference, you get decibels by multiplying 20 with its log10 value.

---

<div class="post-metadata">

### Author: ![mb2007](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mb2007/32/22590_2.png) [@mb2007](https://community.mp3tag.de/u/mb2007)
#### Post date: [April 5, 2024, 8:48pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/18 "2024-04-05T20:48:20Z")

</div>

Yes, but that's a non-issue because foobar2000 has already properly used oversampling to ascertain the BS.1770-3 true-peak value and has saved it in the audio file as the ReplayGain track peak. The OP doesn't expect Mp3tag to analyze the audio, but rather just to display this as a dB value, as foobar2000 can do. So all Mp3tag needs to do is numerical conversion, which I suspect is currently possible, just convoluted.

[message edited to fix my "Mp3gain" typos]

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:30pm UTC](https://community.mp3tag.de/t/replaygain-track-peak-in-db/61892/19 "2026-02-09T12:30:08Z")

</div>


