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!
There is no way to do this in a logical way.
See here.
"Peak level is a dimensionless quantity with 1.000000 representing full scale. No suffix is included on peak values."
This is what the Foobar wiki 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?
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.
I think you are missing the point of my enquiry and that is how to get MP3Tag to calculate and display that calculation.
MP3Tag
vs
Foobar
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.
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!
So, how do I get the correct original value back?
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.
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.
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. 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.
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.
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.