//$headerstring = $this->fread(1441); // worst-case max length = 32kHz @ 320kbps layer 3 = 1441 bytes/frame
$headerstring =
$this->
fread(226
); // LAME header at offset 36 + 190 bytes of Xing/LAME data
// MP3 audio frame structure:
// $aa $aa $aa $aa [$bb $bb] $cc...
// where $aa..$aa is the four-byte mpeg-audio header (below)
// $bb $bb is the optional 2-byte CRC
// and $cc... is the audio data
$head4 =
substr($headerstring, 0, 4
);
$head4_key = getid3_lib::
PrintHexBytes($head4, true, false, false
);
static $MPEGaudioHeaderDecodeCache = array
();
if (isset($MPEGaudioHeaderDecodeCache[$head4_key])) { $MPEGheaderRawArray =
$MPEGaudioHeaderDecodeCache[$head4_key];
} else { $MPEGheaderRawArray = self::
MPEGaudioHeaderDecode($head4);
$MPEGaudioHeaderDecodeCache[$head4_key] =
$MPEGheaderRawArray;
} static $MPEGaudioHeaderValidCache = array
();
if (!
isset($MPEGaudioHeaderValidCache[$head4_key])) { // Not in cache
//$MPEGaudioHeaderValidCache[$head4_key] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, true); // allow badly-formatted freeformat (from LAME 3.90 - 3.93.1)