Menu

#45 rounded peak data may trigger false clipping alert

v1.0 (example)
open
None
5
2019-01-31
2019-01-31
DeanL
No

With aac files the track peak and album peak data is only recorded with 2 decimal places which are rounded either up or down. When you change the volume level it reads that rounded data and calculates the new track peak based on it and the requested change. The new peek may slightly exceed 1.00 and trigger a clip warning. There may be no actual clipping as it used the rounded data for it's calculations.

example... you have a track with an actual peak of 0.7952. When aacgain saves the data it records it rounded up to 0.80. If you increase the volume and it calculates a new peak of say 1.001 it will trigger a clip warning when no actual clipping will occur. The false positive is from the original data being rounded up.

As is you would need to force re-calculation every time to ensure the peak data is acurate.
The simplest change to the code would be to increase the precision and add more decimal places by...

 changing %-.2f to %-.4f

Discussion


Log in to post a comment.

MongoDB Logo MongoDB