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.au.php.
References $info, AUdataFormatBitsPerSampleLookup(), AUdataFormatNameLookup(), AUdataFormatUsedBitsPerSampleLookup(), getid3_lib\BigEndian2Int(), getid3_handler\fread(), getid3_handler\fseek(), and getid3_lib\PrintHexBytes().
22 $info = &$this->getid3->info;
25 $AUheader = $this->
fread(8);
28 if (substr($AUheader, 0, 4) != $magic) {
29 $info[
'error'][] =
'Expecting "'.getid3_lib::PrintHexBytes($magic).
'" (".snd") at offset '.
$info[
'avdataoffset'].
', found "'.
getid3_lib::PrintHexBytes(substr($AUheader, 0, 4)).
'"';
34 $info[
'au'] = array();
35 $thisfile_au = &
$info[
'au'];
37 $info[
'fileformat'] =
'au';
38 $info[
'audio'][
'dataformat'] =
'au';
39 $info[
'audio'][
'bitrate_mode'] =
'cbr';
40 $thisfile_au[
'encoding'] =
'ISO-8859-1';
43 $AUheader .= $this->
fread($thisfile_au[
'header_length'] - 8);
44 $info[
'avdataoffset'] += $thisfile_au[
'header_length'];
50 $thisfile_au[
'comments'][
'comment'][] = trim(substr($AUheader, 24));
55 $info[
'audio'][
'bits_per_sample'] = $thisfile_au[
'bits_per_sample'];
57 unset($thisfile_au[
'bits_per_sample']);
60 $info[
'audio'][
'sample_rate'] = $thisfile_au[
'sample_rate'];
61 $info[
'audio'][
'channels'] = $thisfile_au[
'channels'];
63 if ((
$info[
'avdataoffset'] + $thisfile_au[
'data_size']) >
$info[
'avdataend']) {
64 $info[
'warning'][] =
'Possible truncated file - expecting "'.$thisfile_au[
'data_size'].
'" bytes of audio data, only found '.(
$info[
'avdataend'] -
$info[
'avdataoffset']).
' bytes"';
67 $info[
'playtime_seconds'] = $thisfile_au[
'data_size'] / ($thisfile_au[
'sample_rate'] * $thisfile_au[
'channels'] * ($thisfile_au[
'used_bits_per_sample'] / 8));
68 $info[
'audio'][
'bitrate'] = ($thisfile_au[
'data_size'] * 8) /
$info[
'playtime_seconds'];
AUdataFormatBitsPerSampleLookup($id)
AUdataFormatNameLookup($id)
BigEndian2Int($byteword, $synchsafe=false, $signed=false)
AUdataFormatUsedBitsPerSampleLookup($id)
fseek($bytes, $whence=SEEK_SET)
PrintHexBytes($string, $hex=true, $spaces=true, $htmlsafe=true)
◆ AUdataFormatBitsPerSampleLookup() [1/2]
getid3_au::AUdataFormatBitsPerSampleLookup |
( |
|
$id | ) |
|
Definition at line 104 of file module.audio.au.php.
Referenced by Analyze(), and getid3_au().
105 static $AUdataFormatBitsPerSampleLookup = array(
129 return (isset($AUdataFormatBitsPerSampleLookup[$id]) ? $AUdataFormatBitsPerSampleLookup[$id] :
false);
◆ AUdataFormatBitsPerSampleLookup() [2/2]
getid3_au::AUdataFormatBitsPerSampleLookup |
( |
|
$id | ) |
|
Definition at line 107 of file module.audio.au.php.
108 static $AUdataFormatBitsPerSampleLookup = array(
132 return (isset($AUdataFormatBitsPerSampleLookup[$id]) ? $AUdataFormatBitsPerSampleLookup[$id] :
false);
◆ AUdataFormatNameLookup() [1/2]
getid3_au::AUdataFormatNameLookup |
( |
|
$id | ) |
|
Definition at line 70 of file module.audio.au.php.
Referenced by Analyze(), and getid3_au().
71 static $AUdataFormatNameLookup = array(
72 0 =>
'unspecified format',
78 6 =>
'floating-point',
79 7 =>
'double-precision float',
80 8 =>
'fragmented sampled data',
81 9 =>
'SUN_FORMAT_NESTED',
83 11 =>
'8-bit fixed-point',
84 12 =>
'16-bit fixed-point',
85 13 =>
'24-bit fixed-point',
86 14 =>
'32-bit fixed-point',
88 16 =>
'non-audio display data',
89 17 =>
'SND_FORMAT_MULAW_SQUELCH',
90 18 =>
'16-bit linear with emphasis',
91 19 =>
'16-bit linear with compression',
92 20 =>
'16-bit linear with emphasis + compression',
93 21 =>
'Music Kit DSP commands',
94 22 =>
'SND_FORMAT_DSP_COMMANDS_SAMPLES',
95 23 =>
'CCITT g.721 4-bit ADPCM',
96 24 =>
'CCITT g.722 ADPCM',
97 25 =>
'CCITT g.723 3-bit ADPCM',
98 26 =>
'CCITT g.723 5-bit ADPCM',
101 return (isset($AUdataFormatNameLookup[$id]) ? $AUdataFormatNameLookup[$id] :
false);
◆ AUdataFormatNameLookup() [2/2]
getid3_au::AUdataFormatNameLookup |
( |
|
$id | ) |
|
Definition at line 73 of file module.audio.au.php.
74 static $AUdataFormatNameLookup = array(
75 0 =>
'unspecified format',
81 6 =>
'floating-point',
82 7 =>
'double-precision float',
83 8 =>
'fragmented sampled data',
84 9 =>
'SUN_FORMAT_NESTED',
86 11 =>
'8-bit fixed-point',
87 12 =>
'16-bit fixed-point',
88 13 =>
'24-bit fixed-point',
89 14 =>
'32-bit fixed-point',
91 16 =>
'non-audio display data',
92 17 =>
'SND_FORMAT_MULAW_SQUELCH',
93 18 =>
'16-bit linear with emphasis',
94 19 =>
'16-bit linear with compression',
95 20 =>
'16-bit linear with emphasis + compression',
96 21 =>
'Music Kit DSP commands',
97 22 =>
'SND_FORMAT_DSP_COMMANDS_SAMPLES',
98 23 =>
'CCITT g.721 4-bit ADPCM',
99 24 =>
'CCITT g.722 ADPCM',
100 25 =>
'CCITT g.723 3-bit ADPCM',
101 26 =>
'CCITT g.723 5-bit ADPCM',
104 return (isset($AUdataFormatNameLookup[$id]) ? $AUdataFormatNameLookup[$id] :
false);
◆ AUdataFormatUsedBitsPerSampleLookup() [1/2]
getid3_au::AUdataFormatUsedBitsPerSampleLookup |
( |
|
$id | ) |
|
Definition at line 132 of file module.audio.au.php.
Referenced by Analyze(), and getid3_au().
133 static $AUdataFormatUsedBitsPerSampleLookup = array(
157 return (isset($AUdataFormatUsedBitsPerSampleLookup[$id]) ? $AUdataFormatUsedBitsPerSampleLookup[$id] :
false);
◆ AUdataFormatUsedBitsPerSampleLookup() [2/2]
getid3_au::AUdataFormatUsedBitsPerSampleLookup |
( |
|
$id | ) |
|
Definition at line 135 of file module.audio.au.php.
136 static $AUdataFormatUsedBitsPerSampleLookup = array(
160 return (isset($AUdataFormatUsedBitsPerSampleLookup[$id]) ? $AUdataFormatUsedBitsPerSampleLookup[$id] :
false);
◆ getid3_au()
getid3_au::getid3_au |
( |
& |
$fd, |
|
|
& |
$ThisFileInfo |
|
) |
| |
Definition at line 20 of file module.audio.au.php.
References AUdataFormatBitsPerSampleLookup(), AUdataFormatNameLookup(), AUdataFormatUsedBitsPerSampleLookup(), getid3_lib\BigEndian2Int(), getid3_handler\fread(), and getid3_handler\fseek().
22 fseek($fd, $ThisFileInfo[
'avdataoffset'], SEEK_SET);
23 $AUheader =
fread($fd, 8);
25 if (substr($AUheader, 0, 4) !=
'.snd') {
26 $ThisFileInfo[
'error'][] =
'Expecting ".snd" at offset '.$ThisFileInfo[
'avdataoffset'].
', found "'.substr($AUheader, 0, 4).
'"';
31 $ThisFileInfo[
'au'] = array();
32 $thisfile_au = &$ThisFileInfo[
'au'];
34 $ThisFileInfo[
'fileformat'] =
'au';
35 $ThisFileInfo[
'audio'][
'dataformat'] =
'au';
36 $ThisFileInfo[
'audio'][
'bitrate_mode'] =
'cbr';
37 $thisfile_au[
'encoding'] =
'ISO-8859-1';
40 $AUheader .=
fread($fd, $thisfile_au[
'header_length'] - 8);
41 $ThisFileInfo[
'avdataoffset'] += $thisfile_au[
'header_length'];
47 $thisfile_au[
'comments'][
'comment'][] = trim(substr($AUheader, 24));
52 $ThisFileInfo[
'audio'][
'bits_per_sample'] = $thisfile_au[
'bits_per_sample'];
54 unset($thisfile_au[
'bits_per_sample']);
57 $ThisFileInfo[
'audio'][
'sample_rate'] = $thisfile_au[
'sample_rate'];
58 $ThisFileInfo[
'audio'][
'channels'] = $thisfile_au[
'channels'];
60 if (($ThisFileInfo[
'avdataoffset'] + $thisfile_au[
'data_size']) > $ThisFileInfo[
'avdataend']) {
61 $ThisFileInfo[
'warning'][] =
'Possible truncated file - expecting "'.$thisfile_au[
'data_size'].
'" bytes of audio data, only found '.($ThisFileInfo[
'avdataend'] - $ThisFileInfo[
'avdataoffset']).
' bytes"';
64 $ThisFileInfo[
'playtime_seconds'] = $thisfile_au[
'data_size'] / ($thisfile_au[
'sample_rate'] * $thisfile_au[
'channels'] * ($thisfile_au[
'used_bits_per_sample'] / 8));
65 $ThisFileInfo[
'audio'][
'bitrate'] = ($thisfile_au[
'data_size'] * 8) / $ThisFileInfo[
'playtime_seconds'];
AUdataFormatBitsPerSampleLookup($id)
AUdataFormatNameLookup($id)
BigEndian2Int($byteword, $synchsafe=false, $signed=false)
AUdataFormatUsedBitsPerSampleLookup($id)
fseek($bytes, $whence=SEEK_SET)
The documentation for this class was generated from the following file: