getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //
More...
◆ Analyze()
Definition at line 21 of file module.audio.rkau.php.
References $info, getid3_handler\error(), getid3_handler\fread(), getid3_handler\fseek(), getid3_lib\LittleEndian2Int(), getid3_lib\PrintHexBytes(), and RKAUqualityLookup().
22 $info = &$this->getid3->info;
25 $RKAUHeader = $this->
fread(20);
27 if (substr($RKAUHeader, 0, 3) != $magic) {
32 $info[
'fileformat'] =
'rkau';
33 $info[
'audio'][
'dataformat'] =
'rkau';
34 $info[
'audio'][
'bitrate_mode'] =
'vbr';
37 $info[
'rkau'][
'version'] =
'1.'.str_pad(
$info[
'rkau'][
'raw'][
'version'] & 0x0F, 2,
'0', STR_PAD_LEFT);
38 if ((
$info[
'rkau'][
'version'] > 1.07) || (
$info[
'rkau'][
'version'] < 1.06)) {
39 $this->
error(
'This version of getID3() ['.$this->getid3->version().
'] can only parse RKAU files v1.06 and 1.07 (this file is v'.
$info[
'rkau'][
'version'].
')');
53 $info[
'rkau'][
'flags'][
'joint_stereo'] = (bool) (!(
$info[
'rkau'][
'raw'][
'flags'] & 0x01));
54 $info[
'rkau'][
'flags'][
'streaming'] = (bool) (
$info[
'rkau'][
'raw'][
'flags'] & 0x02);
55 $info[
'rkau'][
'flags'][
'vrq_lossy_mode'] = (bool) (
$info[
'rkau'][
'raw'][
'flags'] & 0x04);
57 if (
$info[
'rkau'][
'flags'][
'streaming']) {
58 $info[
'avdataoffset'] += 20;
61 $info[
'avdataoffset'] += 16;
62 $info[
'rkau'][
'compressed_bytes'] =
$info[
'avdataend'] -
$info[
'avdataoffset'] - 1;
67 $info[
'audio'][
'lossless'] =
$info[
'rkau'][
'lossless'];
68 $info[
'audio'][
'channels'] =
$info[
'rkau'][
'channels'];
69 $info[
'audio'][
'bits_per_sample'] =
$info[
'rkau'][
'bits_per_sample'];
70 $info[
'audio'][
'sample_rate'] =
$info[
'rkau'][
'sample_rate'];
72 $info[
'playtime_seconds'] =
$info[
'rkau'][
'source_bytes'] / (
$info[
'rkau'][
'sample_rate'] *
$info[
'rkau'][
'channels'] * (
$info[
'rkau'][
'bits_per_sample'] / 8));
73 $info[
'audio'][
'bitrate'] = (
$info[
'rkau'][
'compressed_bytes'] * 8) /
$info[
'playtime_seconds'];
RKAUqualityLookup(&$RKAUdata)
static LittleEndian2Int($byteword, $signed=false)
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
fseek($bytes, $whence=SEEK_SET)
◆ RKAUqualityLookup()
getid3_rkau::RKAUqualityLookup |
( |
& |
$RKAUdata | ) |
|
Definition at line 80 of file module.audio.rkau.php.
Referenced by Analyze().
81 $level = ($RKAUdata[
'raw'][
'quality'] & 0xF0) >> 4;
82 $quality = $RKAUdata[
'raw'][
'quality'] & 0x0F;
84 $RKAUdata[
'lossless'] = (($quality == 0) ?
true :
false);
85 $RKAUdata[
'compression_level'] = $level + 1;
86 if (!$RKAUdata[
'lossless']) {
87 $RKAUdata[
'quality_setting'] = $quality;
The documentation for this class was generated from the following file: