33 $info = &$this->getid3->info;
74 $info[
'fileformat'] =
'avr';
76 fseek($this->getid3->fp,
$info[
'avdataoffset'], SEEK_SET);
77 $AVRheader =
fread($this->getid3->fp, 128);
79 $info[
'avr'][
'raw'][
'magic'] = substr($AVRheader, 0, 4);
81 if (
$info[
'avr'][
'raw'][
'magic'] != $magic) {
83 unset(
$info[
'fileformat']);
88 $info[
'avdataoffset'] += 128;
90 $info[
'avr'][
'sample_name'] = rtrim(substr($AVRheader, 4, 8));
128 $info[
'avr'][
'sample_name_extra'] = rtrim(substr($AVRheader, 44, 20));
129 $info[
'avr'][
'comment'] = rtrim(substr($AVRheader, 64, 64));
131 $info[
'avr'][
'flags'][
'stereo'] = ((
$info[
'avr'][
'raw'][
'mono'] == 0) ?
false :
true);
132 $info[
'avr'][
'flags'][
'signed'] = ((
$info[
'avr'][
'raw'][
'signed'] == 0) ?
false :
true);
133 $info[
'avr'][
'flags'][
'loop'] = ((
$info[
'avr'][
'raw'][
'loop'] == 0) ?
false :
true);
136 if ((
$info[
'avr'][
'raw'][
'midi'] & 0xFF00) != 0xFF00) {
137 $info[
'avr'][
'midi_notes'][] = (
$info[
'avr'][
'raw'][
'midi'] & 0xFF00) >> 8;
139 if ((
$info[
'avr'][
'raw'][
'midi'] & 0x00FF) != 0x00FF) {
140 $info[
'avr'][
'midi_notes'][] = (
$info[
'avr'][
'raw'][
'midi'] & 0x00FF);
143 if ((
$info[
'avdataend'] -
$info[
'avdataoffset']) != (
$info[
'avr'][
'sample_length'] * ((
$info[
'avr'][
'bits_per_sample'] == 8) ? 1 : 2))) {
144 $info[
'warning'][] =
'Probable truncated file: expecting ' . ($info[
'avr'][
'sample_length'] * (($info[
'avr'][
'bits_per_sample'] == 8) ? 1 : 2)) .
' bytes of audio data, found ' . ($info[
'avdataend'] - $info[
'avdataoffset']);
147 $info[
'audio'][
'dataformat'] =
'avr';
148 $info[
'audio'][
'lossless'] =
true;
149 $info[
'audio'][
'bitrate_mode'] =
'cbr';
150 $info[
'audio'][
'bits_per_sample'] = $info[
'avr'][
'bits_per_sample'];
151 $info[
'audio'][
'sample_rate'] = $info[
'avr'][
'sample_rate'];
152 $info[
'audio'][
'channels'] = ($info[
'avr'][
'flags'][
'stereo'] ? 2 : 1);
153 $info[
'playtime_seconds'] = ($info[
'avr'][
'sample_length'] / $info[
'audio'][
'channels']) / $info[
'avr'][
'sample_rate'];
154 $info[
'audio'][
'bitrate'] = ($info[
'avr'][
'sample_length'] * (($info[
'avr'][
'bits_per_sample'] == 8) ? 8 : 16)) / $info[
'playtime_seconds'];
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
GetId3() by James Heinrich info@getid3.org //.
fseek($bytes, $whence=SEEK_SET)
Create styles array
The data for the language used.
static BigEndian2Int($byteword, $synchsafe=false, $signed=false)
GetId3() by James Heinrich info@getid3.org //.