22 fseek($fd, $ThisFileInfo[
'avdataoffset'], SEEK_SET);
23 $RKAUHeader = fread($fd, 20);
24 if (substr($RKAUHeader, 0, 3) !=
'RKA') {
25 $ThisFileInfo[
'error'][] =
'Expecting "RKA" at offset '.$ThisFileInfo[
'avdataoffset'].
', found "'.substr($RKAUHeader, 0, 3).
'"';
29 $ThisFileInfo[
'fileformat'] =
'rkau';
30 $ThisFileInfo[
'audio'][
'dataformat'] =
'rkau';
31 $ThisFileInfo[
'audio'][
'bitrate_mode'] =
'vbr';
34 $ThisFileInfo[
'rkau'][
'version'] =
'1.'.str_pad($ThisFileInfo[
'rkau'][
'raw'][
'version'] & 0x0F, 2,
'0', STR_PAD_LEFT);
35 if (($ThisFileInfo[
'rkau'][
'version'] > 1.07) || ($ThisFileInfo[
'rkau'][
'version'] < 1.06)) {
36 $ThisFileInfo[
'error'][] =
'This version of getID3() can only parse RKAU files v1.06 and 1.07 (this file is v'.$ThisFileInfo[
'rkau'][
'version'].
')';
37 unset($ThisFileInfo[
'rkau']);
50 $ThisFileInfo[
'rkau'][
'flags'][
'joint_stereo'] = (bool) (!($ThisFileInfo[
'rkau'][
'raw'][
'flags'] & 0x01));
51 $ThisFileInfo[
'rkau'][
'flags'][
'streaming'] = (bool) ($ThisFileInfo[
'rkau'][
'raw'][
'flags'] & 0x02);
52 $ThisFileInfo[
'rkau'][
'flags'][
'vrq_lossy_mode'] = (bool) ($ThisFileInfo[
'rkau'][
'raw'][
'flags'] & 0x04);
54 if ($ThisFileInfo[
'rkau'][
'flags'][
'streaming']) {
55 $ThisFileInfo[
'avdataoffset'] += 20;
58 $ThisFileInfo[
'avdataoffset'] += 16;
59 $ThisFileInfo[
'rkau'][
'compressed_bytes'] = $ThisFileInfo[
'avdataend'] - $ThisFileInfo[
'avdataoffset'] - 1;
64 $ThisFileInfo[
'audio'][
'lossless'] = $ThisFileInfo[
'rkau'][
'lossless'];
65 $ThisFileInfo[
'audio'][
'channels'] = $ThisFileInfo[
'rkau'][
'channels'];
66 $ThisFileInfo[
'audio'][
'bits_per_sample'] = $ThisFileInfo[
'rkau'][
'bits_per_sample'];
67 $ThisFileInfo[
'audio'][
'sample_rate'] = $ThisFileInfo[
'rkau'][
'sample_rate'];
69 $ThisFileInfo[
'playtime_seconds'] = $ThisFileInfo[
'rkau'][
'source_bytes'] / ($ThisFileInfo[
'rkau'][
'sample_rate'] * $ThisFileInfo[
'rkau'][
'channels'] * ($ThisFileInfo[
'rkau'][
'bits_per_sample'] / 8));
70 $ThisFileInfo[
'audio'][
'bitrate'] = ($ThisFileInfo[
'rkau'][
'compressed_bytes'] * 8) / $ThisFileInfo[
'playtime_seconds'];
78 $level = ($RKAUdata[
'raw'][
'quality'] & 0xF0) >> 4;
79 $quality = $RKAUdata[
'raw'][
'quality'] & 0x0F;
81 $RKAUdata[
'lossless'] = (($quality == 0) ?
true :
false);
82 $RKAUdata[
'compression_level'] = $level + 1;
83 if (!$RKAUdata[
'lossless']) {
84 $RKAUdata[
'quality_setting'] = $quality;