38 $info = &$this->getid3->info;
40 fseek($this->getid3->fp,
$info[
'avdataoffset'], SEEK_SET);
41 $AUheader =
fread($this->getid3->fp, 8);
44 if (substr($AUheader, 0, 4) != $magic) {
45 $info[
'error'][] =
'Expecting "'.Helper::PrintHexBytes($magic).
'" (".snd") at offset '.
$info[
'avdataoffset'].
', found "'.
Helper::PrintHexBytes(substr($AUheader, 0, 4)).
'"';
52 $thisfile_au = &
$info[
'au'];
54 $info[
'fileformat'] =
'au';
55 $info[
'audio'][
'dataformat'] =
'au';
56 $info[
'audio'][
'bitrate_mode'] =
'cbr';
57 $thisfile_au[
'encoding'] =
'ISO-8859-1';
60 $AUheader .=
fread($this->getid3->fp, $thisfile_au[
'header_length'] - 8);
61 $info[
'avdataoffset'] += $thisfile_au[
'header_length'];
67 $thisfile_au[
'comments'][
'comment'][] = trim(substr($AUheader, 24));
72 $info[
'audio'][
'bits_per_sample'] = $thisfile_au[
'bits_per_sample'];
74 unset($thisfile_au[
'bits_per_sample']);
77 $info[
'audio'][
'sample_rate'] = $thisfile_au[
'sample_rate'];
78 $info[
'audio'][
'channels'] = $thisfile_au[
'channels'];
80 if ((
$info[
'avdataoffset'] + $thisfile_au[
'data_size']) >
$info[
'avdataend']) {
81 $info[
'warning'][] =
'Possible truncated file - expecting "'.$thisfile_au[
'data_size'].
'" bytes of audio data, only found '.(
$info[
'avdataend'] -
$info[
'avdataoffset']).
' bytes"';
84 $info[
'playtime_seconds'] = $thisfile_au[
'data_size'] / ($thisfile_au[
'sample_rate'] * $thisfile_au[
'channels'] * ($thisfile_au[
'used_bits_per_sample'] / 8));
85 $info[
'audio'][
'bitrate'] = ($thisfile_au[
'data_size'] * 8) /
$info[
'playtime_seconds'];
98 static $AUdataFormatNameLookup =
array(
99 0 =>
'unspecified format',
102 3 =>
'16-bit linear',
103 4 =>
'24-bit linear',
104 5 =>
'32-bit linear',
105 6 =>
'floating-point',
106 7 =>
'double-precision float',
107 8 =>
'fragmented sampled data',
108 9 =>
'SUN_FORMAT_NESTED',
110 11 =>
'8-bit fixed-point',
111 12 =>
'16-bit fixed-point',
112 13 =>
'24-bit fixed-point',
113 14 =>
'32-bit fixed-point',
115 16 =>
'non-audio display data',
116 17 =>
'SND_FORMAT_MULAW_SQUELCH',
117 18 =>
'16-bit linear with emphasis',
118 19 =>
'16-bit linear with compression',
119 20 =>
'16-bit linear with emphasis + compression',
120 21 =>
'Music Kit DSP commands',
121 22 =>
'SND_FORMAT_DSP_COMMANDS_SAMPLES',
122 23 =>
'CCITT g.721 4-bit ADPCM',
123 24 =>
'CCITT g.722 ADPCM',
124 25 =>
'CCITT g.723 3-bit ADPCM',
125 26 =>
'CCITT g.723 5-bit ADPCM',
129 return (isset($AUdataFormatNameLookup[$id]) ? $AUdataFormatNameLookup[$id] :
false);
140 static $AUdataFormatBitsPerSampleLookup =
array(
165 return (isset($AUdataFormatBitsPerSampleLookup[$id]) ? $AUdataFormatBitsPerSampleLookup[$id] :
false);
176 static $AUdataFormatUsedBitsPerSampleLookup =
array(
201 return (isset($AUdataFormatUsedBitsPerSampleLookup[$id]) ? $AUdataFormatUsedBitsPerSampleLookup[$id] :
false);
GetId3() by James Heinrich info@getid3.org //.
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
GetId3() by James Heinrich info@getid3.org //.
AUdataFormatBitsPerSampleLookup($id)
array $AUdataFormatBitsPerSampleLookup
fseek($bytes, $whence=SEEK_SET)
Create styles array
The data for the language used.
AUdataFormatNameLookup($id)
array $AUdataFormatNameLookup
static BigEndian2Int($byteword, $synchsafe=false, $signed=false)
AUdataFormatUsedBitsPerSampleLookup($id)
array $AUdataFormatUsedBitsPerSampleLookup