// bytes $A7-$AE Replay Gain
// https://web.archive.org/web/20021015212753/http://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html
// bytes $A7-$AA : 32 bit floating point "Peak signal amplitude"
if ($thisfile_mpeg_audio_lame['short_version'
] >= 'LAME3.94b'
) { // LAME 3.94a16 and later - 9.23 fixed point
// ie 0x0059E2EE / (2^23) = 5890798 / 8388608 = 0.7022378444671630859375
$thisfile_mpeg_audio_lame_RGAD['peak_amplitude'
] =
(float) ((getid3_lib::
BigEndian2Int(substr($headerstring,
$LAMEtagOffsetContant + 0xA7, 4
))) / 8388608
);
} else { // LAME 3.94a15 and earlier - 32-bit floating point
// Actually 3.94a16 will fall in here too and be WRONG, but is hard to detect 3.94a16 vs 3.94a15
$thisfile_mpeg_audio_lame_RGAD['peak_amplitude'
] = getid3_lib::
LittleEndian2Float(substr($headerstring,
$LAMEtagOffsetContant + 0xA7, 4
));
} if ($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'
] == 0
) { unset($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'
]);
} else { $thisfile_mpeg_audio_lame_RGAD['peak_db'
] = getid3_lib::
RGADamplitude2dB($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'
]);
} $thisfile_mpeg_audio_lame_raw['RGAD_track'
] = getid3_lib::
BigEndian2Int(substr($headerstring,
$LAMEtagOffsetContant + 0xAB, 2
));
$thisfile_mpeg_audio_lame_raw['RGAD_album'
] = getid3_lib::
BigEndian2Int(substr($headerstring,
$LAMEtagOffsetContant + 0xAD, 2
));