Skip to main content

Topic: "True peak" and ReplayGain (Read 475 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Jebus
  • [*][*][*][*][*]
  • Developer
"True peak" and ReplayGain
Pardon if this has been asked before...

If i'm writing a ReplayGain (2.0) implementation, is there any value in calculating "true peak" values rather than sample peaks? If so, these are often above 1.0 - should I store a maximum of 1.000000?

The specification says that lossy files may have peaks over 1.0, but lossless files really shouldn't be able to. This is of course unless we're talking about true peaks.

Maybe i'll just avoid the whole issue and store sample peaks. I guess this field is of dubious utility anyhow.

http://wiki.hydrogenaud.io/index.php?title=ReplayGain_2.0_specification#Peak_amplitude

  • kode54
  • [*][*][*][*][*]
  • Administrator
Re: "True peak" and ReplayGain
Reply #1
Intersample peaks may affect playback hardware, but probably won't be noticeable in most situations.

  • bennetng
  • [*][*][*][*][*]
Re: "True peak" and ReplayGain
Reply #2
At least foobar doesn't use true peak.
https://hydrogenaud.io/index.php/topic,114125.msg940028.html#msg940028

Anyway there is no truth about TP, different VST plugins report different TP values, and some product advertisements said their implementation are better than the one described in BS.1770.
https://forum.cockos.com/showpost.php?p=1843694&postcount=95
  • Last Edit: 04 November, 2017, 12:37:24 AM by bennetng

  • Case
  • [*][*][*][*][*]
  • Developer (Donating)
Re: "True peak" and ReplayGain
Reply #3
Small correction to bennetng's claim, foobar2000 has had True Peak capability since version 1.3.9. It's not enabled by default but user can specify oversample factor in preferences.

How useful it is depends on files. In regular music small clipping goes unnoticed but with special signals it can make a huge difference.

I'll attach a test file you can try with WASAPI output at 100% volume to see for yourself. If you don't use clipping prevention vast majority of DACs will play the file audibly wrong. The peak value was scanned with foobar2000 using 4x oversampling, which is enough for the source file's sampling rate.

  • bennetng
  • [*][*][*][*][*]
Re: "True peak" and ReplayGain
Reply #4
Thanks for telling me about the oversampling factor which I overlooked. I never touch it and the default is 1.

[EDIT]Enabled 4x oversampling and scanned the SquareSweep.wav in the attachment of this post
https://hydrogenaud.io/index.php/topic,114125.msg940028.html#msg940028

Now the 4x oversampled RG shows 1.743334, which means +4.83dBTP, but I needed to reduce 6dB in my video to completely eliminate clipping for the Realtek.
  • Last Edit: 04 November, 2017, 06:23:47 AM by bennetng