38 $info = &$this->getid3->info;
40 fseek($this->getid3->fp,
$info[
'avdataoffset'], SEEK_SET);
41 $RKAUHeader =
fread($this->getid3->fp, 20);
43 if (substr($RKAUHeader, 0, 3) != $magic) {
44 $info[
'error'][] =
'Expecting "'.Helper::PrintHexBytes($magic).
'" at offset '.
$info[
'avdataoffset'].
', found "'.
Helper::PrintHexBytes(substr($RKAUHeader, 0, 3)).
'"';
49 $info[
'fileformat'] =
'rkau';
50 $info[
'audio'][
'dataformat'] =
'rkau';
51 $info[
'audio'][
'bitrate_mode'] =
'vbr';
54 $info[
'rkau'][
'version'] =
'1.'.str_pad(
$info[
'rkau'][
'raw'][
'version'] & 0x0F, 2,
'0', STR_PAD_LEFT);
55 if ((
$info[
'rkau'][
'version'] > 1.07) || (
$info[
'rkau'][
'version'] < 1.06)) {
56 $info[
'error'][] =
'This version of GetId3Core() ['.$this->getid3->version().
'] can only parse RKAU files v1.06 and 1.07 (this file is v'.
$info[
'rkau'][
'version'].
')';
71 $info[
'rkau'][
'flags'][
'joint_stereo'] = (bool) (!(
$info[
'rkau'][
'raw'][
'flags'] & 0x01));
72 $info[
'rkau'][
'flags'][
'streaming'] = (bool) (
$info[
'rkau'][
'raw'][
'flags'] & 0x02);
73 $info[
'rkau'][
'flags'][
'vrq_lossy_mode'] = (bool) (
$info[
'rkau'][
'raw'][
'flags'] & 0x04);
75 if (
$info[
'rkau'][
'flags'][
'streaming']) {
76 $info[
'avdataoffset'] += 20;
79 $info[
'avdataoffset'] += 16;
80 $info[
'rkau'][
'compressed_bytes'] =
$info[
'avdataend'] -
$info[
'avdataoffset'] - 1;
85 $info[
'audio'][
'lossless'] =
$info[
'rkau'][
'lossless'];
86 $info[
'audio'][
'channels'] =
$info[
'rkau'][
'channels'];
87 $info[
'audio'][
'bits_per_sample'] =
$info[
'rkau'][
'bits_per_sample'];
88 $info[
'audio'][
'sample_rate'] =
$info[
'rkau'][
'sample_rate'];
90 $info[
'playtime_seconds'] =
$info[
'rkau'][
'source_bytes'] / (
$info[
'rkau'][
'sample_rate'] *
$info[
'rkau'][
'channels'] * (
$info[
'rkau'][
'bits_per_sample'] / 8));
91 $info[
'audio'][
'bitrate'] = (
$info[
'rkau'][
'compressed_bytes'] * 8) /
$info[
'playtime_seconds'];
104 $level = ($RKAUdata[
'raw'][
'quality'] & 0xF0) >> 4;
105 $quality = $RKAUdata[
'raw'][
'quality'] & 0x0F;
107 $RKAUdata[
'lossless'] = (($quality == 0) ?
true :
false);
108 $RKAUdata[
'compression_level'] = $level + 1;
109 if (!$RKAUdata[
'lossless']) {
110 $RKAUdata[
'quality_setting'] = $quality;
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
GetId3() by James Heinrich info@getid3.org //.
fseek($bytes, $whence=SEEK_SET)
GetId3() by James Heinrich info@getid3.org //.
RKAUqualityLookup(&$RKAUdata)
static LittleEndian2Int($byteword, $signed=false)