ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
getid3_bonk Class Reference

getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g // More...

+ Inheritance diagram for getid3_bonk:
+ Collaboration diagram for getid3_bonk:

Public Member Functions

 getid3_bonk (&$fd, &$ThisFileInfo)
 
 HandleBonkTags (&$fd, &$BonkTagName, &$ThisFileInfo)
 
 BonkIsValidTagName ($PossibleBonkTag, $ignorecase=false)
 
 Analyze ()
 
 HandleBonkTags ($BonkTagName)
 
- Public Member Functions inherited from getid3_handler
 __construct (getID3 $getid3, $call_module=null)
 
 Analyze ()
 
 AnalyzeString ($string)
 
 setStringMode ($string)
 
 saveAttachment ($name, $offset, $length, $image_mime=null)
 

Static Public Member Functions

static BonkIsValidTagName ($PossibleBonkTag, $ignorecase=false)
 

Additional Inherited Members

- Protected Member Functions inherited from getid3_handler
 ftell ()
 
 fread ($bytes)
 
 fseek ($bytes, $whence=SEEK_SET)
 
 feof ()
 
 isDependencyFor ($module)
 
 error ($text)
 
 warning ($text)
 
 notice ($text)
 
- Protected Attributes inherited from getid3_handler
 $getid3
 
 $data_string_flag = false
 
 $data_string = ''
 
 $data_string_position = 0
 
 $data_string_length = 0
 

Detailed Description

getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //

Definition at line 17 of file module.audio.bonk.php.

Member Function Documentation

◆ Analyze()

getid3_bonk::Analyze ( )

Reimplemented from getid3_handler.

Definition at line 20 of file module.audio.bonk.php.

20 {
21 $info = &$this->getid3->info;
22
23 // shortcut
24 $info['bonk'] = array();
25 $thisfile_bonk = &$info['bonk'];
26
27 $thisfile_bonk['dataoffset'] = $info['avdataoffset'];
28 $thisfile_bonk['dataend'] = $info['avdataend'];
29
30 if (!getid3_lib::intValueSupported($thisfile_bonk['dataend'])) {
31
32 $info['warning'][] = 'Unable to parse BONK file from end (v0.6+ preferred method) because PHP filesystem functions only support up to '.round(PHP_INT_MAX / 1073741824).'GB';
33
34 } else {
35
36 // scan-from-end method, for v0.6 and higher
37 $this->fseek($thisfile_bonk['dataend'] - 8);
38 $PossibleBonkTag = $this->fread(8);
39 while ($this->BonkIsValidTagName(substr($PossibleBonkTag, 4, 4), true)) {
40 $BonkTagSize = getid3_lib::LittleEndian2Int(substr($PossibleBonkTag, 0, 4));
41 $this->fseek(0 - $BonkTagSize, SEEK_CUR);
42 $BonkTagOffset = $this->ftell();
43 $TagHeaderTest = $this->fread(5);
44 if (($TagHeaderTest{0} != "\x00") || (substr($PossibleBonkTag, 4, 4) != strtolower(substr($PossibleBonkTag, 4, 4)))) {
45 $info['error'][] = 'Expecting "'.getid3_lib::PrintHexBytes("\x00".strtoupper(substr($PossibleBonkTag, 4, 4))).'" at offset '.$BonkTagOffset.', found "'.getid3_lib::PrintHexBytes($TagHeaderTest).'"';
46 return false;
47 }
48 $BonkTagName = substr($TagHeaderTest, 1, 4);
49
50 $thisfile_bonk[$BonkTagName]['size'] = $BonkTagSize;
51 $thisfile_bonk[$BonkTagName]['offset'] = $BonkTagOffset;
52 $this->HandleBonkTags($BonkTagName);
53 $NextTagEndOffset = $BonkTagOffset - 8;
54 if ($NextTagEndOffset < $thisfile_bonk['dataoffset']) {
55 if (empty($info['audio']['encoder'])) {
56 $info['audio']['encoder'] = 'Extended BONK v0.9+';
57 }
58 return true;
59 }
60 $this->fseek($NextTagEndOffset);
61 $PossibleBonkTag = $this->fread(8);
62 }
63
64 }
65
66 // seek-from-beginning method for v0.4 and v0.5
67 if (empty($thisfile_bonk['BONK'])) {
68 $this->fseek($thisfile_bonk['dataoffset']);
69 do {
70 $TagHeaderTest = $this->fread(5);
71 switch ($TagHeaderTest) {
72 case "\x00".'BONK':
73 if (empty($info['audio']['encoder'])) {
74 $info['audio']['encoder'] = 'BONK v0.4';
75 }
76 break;
77
78 case "\x00".'INFO':
79 $info['audio']['encoder'] = 'Extended BONK v0.5';
80 break;
81
82 default:
83 break 2;
84 }
85 $BonkTagName = substr($TagHeaderTest, 1, 4);
86 $thisfile_bonk[$BonkTagName]['size'] = $thisfile_bonk['dataend'] - $thisfile_bonk['dataoffset'];
87 $thisfile_bonk[$BonkTagName]['offset'] = $thisfile_bonk['dataoffset'];
88 $this->HandleBonkTags($BonkTagName);
89
90 } while (true);
91 }
92
93 // parse META block for v0.6 - v0.8
94 if (empty($thisfile_bonk['INFO']) && isset($thisfile_bonk['META']['tags']['info'])) {
95 $this->fseek($thisfile_bonk['META']['tags']['info']);
96 $TagHeaderTest = $this->fread(5);
97 if ($TagHeaderTest == "\x00".'INFO') {
98 $info['audio']['encoder'] = 'Extended BONK v0.6 - v0.8';
99
100 $BonkTagName = substr($TagHeaderTest, 1, 4);
101 $thisfile_bonk[$BonkTagName]['size'] = $thisfile_bonk['dataend'] - $thisfile_bonk['dataoffset'];
102 $thisfile_bonk[$BonkTagName]['offset'] = $thisfile_bonk['dataoffset'];
103 $this->HandleBonkTags($BonkTagName);
104 }
105 }
106
107 if (empty($info['audio']['encoder'])) {
108 $info['audio']['encoder'] = 'Extended BONK v0.9+';
109 }
110 if (empty($thisfile_bonk['BONK'])) {
111 unset($info['bonk']);
112 }
113 return true;
114
115 }
BonkIsValidTagName($PossibleBonkTag, $ignorecase=false)
HandleBonkTags(&$fd, &$BonkTagName, &$ThisFileInfo)
fseek($bytes, $whence=SEEK_SET)
Definition: getid3.php:1697
fread($bytes)
Definition: getid3.php:1685
LittleEndian2Int($byteword, $signed=false)
Definition: getid3.lib.php:266
static intValueSupported($num)
Definition: getid3.lib.php:80
PrintHexBytes($string, $hex=true, $spaces=true, $htmlsafe=true)
Definition: getid3.lib.php:17
$info
Definition: example_052.php:80

References $info, BonkIsValidTagName(), getid3_handler\fread(), getid3_handler\fseek(), getid3_handler\ftell(), HandleBonkTags(), getid3_lib\intValueSupported(), getid3_lib\LittleEndian2Int(), and getid3_lib\PrintHexBytes().

+ Here is the call graph for this function:

◆ BonkIsValidTagName() [1/2]

getid3_bonk::BonkIsValidTagName (   $PossibleBonkTag,
  $ignorecase = false 
)

Definition at line 198 of file module.audio.bonk.php.

198 {
199 static $BonkIsValidTagName = array('BONK', 'INFO', ' ID3', 'META');
200 foreach ($BonkIsValidTagName as $validtagname) {
201 if ($validtagname == $PossibleBonkTag) {
202 return true;
203 } elseif ($ignorecase && (strtolower($validtagname) == strtolower($PossibleBonkTag))) {
204 return true;
205 }
206 }
207 return false;
208 }

Referenced by Analyze(), getid3_bonk(), and HandleBonkTags().

+ Here is the caller graph for this function:

◆ BonkIsValidTagName() [2/2]

static getid3_bonk::BonkIsValidTagName (   $PossibleBonkTag,
  $ignorecase = false 
)
static

Definition at line 216 of file module.audio.bonk.php.

216 {
217 static $BonkIsValidTagName = array('BONK', 'INFO', ' ID3', 'META');
218 foreach ($BonkIsValidTagName as $validtagname) {
219 if ($validtagname == $PossibleBonkTag) {
220 return true;
221 } elseif ($ignorecase && (strtolower($validtagname) == strtolower($PossibleBonkTag))) {
222 return true;
223 }
224 }
225 return false;
226 }

◆ getid3_bonk()

getid3_bonk::getid3_bonk ( $fd,
$ThisFileInfo 
)

Definition at line 19 of file module.audio.bonk.php.

19 {
20
21 // shortcut
22 $ThisFileInfo['bonk'] = array();
23 $thisfile_bonk = &$ThisFileInfo['bonk'];
24
25 $thisfile_bonk['dataoffset'] = $ThisFileInfo['avdataoffset'];
26 $thisfile_bonk['dataend'] = $ThisFileInfo['avdataend'];
27
28 // scan-from-end method, for v0.6 and higher
29 fseek($fd, $thisfile_bonk['dataend'] - 8, SEEK_SET);
30 $PossibleBonkTag = fread($fd, 8);
31 while ($this->BonkIsValidTagName(substr($PossibleBonkTag, 4, 4), true)) {
32 $BonkTagSize = getid3_lib::LittleEndian2Int(substr($PossibleBonkTag, 0, 4));
33 fseek($fd, 0 - $BonkTagSize, SEEK_CUR);
34 $BonkTagOffset = ftell($fd);
35 $TagHeaderTest = fread($fd, 5);
36 if (($TagHeaderTest{0} != "\x00") || (substr($PossibleBonkTag, 4, 4) != strtolower(substr($PossibleBonkTag, 4, 4)))) {
37 $ThisFileInfo['error'][] = 'Expecting "Ø'.strtoupper(substr($PossibleBonkTag, 4, 4)).'" at offset '.$BonkTagOffset.', found "'.$TagHeaderTest.'"';
38 return false;
39 }
40 $BonkTagName = substr($TagHeaderTest, 1, 4);
41
42 $thisfile_bonk[$BonkTagName]['size'] = $BonkTagSize;
43 $thisfile_bonk[$BonkTagName]['offset'] = $BonkTagOffset;
44 $this->HandleBonkTags($fd, $BonkTagName, $ThisFileInfo);
45 $NextTagEndOffset = $BonkTagOffset - 8;
46 if ($NextTagEndOffset < $thisfile_bonk['dataoffset']) {
47 if (empty($ThisFileInfo['audio']['encoder'])) {
48 $ThisFileInfo['audio']['encoder'] = 'Extended BONK v0.9+';
49 }
50 return true;
51 }
52 fseek($fd, $NextTagEndOffset, SEEK_SET);
53 $PossibleBonkTag = fread($fd, 8);
54 }
55
56 // seek-from-beginning method for v0.4 and v0.5
57 if (empty($thisfile_bonk['BONK'])) {
58 fseek($fd, $thisfile_bonk['dataoffset'], SEEK_SET);
59 do {
60 $TagHeaderTest = fread($fd, 5);
61 switch ($TagHeaderTest) {
62 case "\x00".'BONK':
63 if (empty($ThisFileInfo['audio']['encoder'])) {
64 $ThisFileInfo['audio']['encoder'] = 'BONK v0.4';
65 }
66 break;
67
68 case "\x00".'INFO':
69 $ThisFileInfo['audio']['encoder'] = 'Extended BONK v0.5';
70 break;
71
72 default:
73 break 2;
74 }
75 $BonkTagName = substr($TagHeaderTest, 1, 4);
76 $thisfile_bonk[$BonkTagName]['size'] = $thisfile_bonk['dataend'] - $thisfile_bonk['dataoffset'];
77 $thisfile_bonk[$BonkTagName]['offset'] = $thisfile_bonk['dataoffset'];
78 $this->HandleBonkTags($fd, $BonkTagName, $ThisFileInfo);
79
80 } while (true);
81 }
82
83 // parse META block for v0.6 - v0.8
84 if (empty($thisfile_bonk['INFO']) && isset($thisfile_bonk['META']['tags']['info'])) {
85 fseek($fd, $thisfile_bonk['META']['tags']['info'], SEEK_SET);
86 $TagHeaderTest = fread($fd, 5);
87 if ($TagHeaderTest == "\x00".'INFO') {
88 $ThisFileInfo['audio']['encoder'] = 'Extended BONK v0.6 - v0.8';
89
90 $BonkTagName = substr($TagHeaderTest, 1, 4);
91 $thisfile_bonk[$BonkTagName]['size'] = $thisfile_bonk['dataend'] - $thisfile_bonk['dataoffset'];
92 $thisfile_bonk[$BonkTagName]['offset'] = $thisfile_bonk['dataoffset'];
93 $this->HandleBonkTags($fd, $BonkTagName, $ThisFileInfo);
94 }
95 }
96
97 if (empty($ThisFileInfo['audio']['encoder'])) {
98 $ThisFileInfo['audio']['encoder'] = 'Extended BONK v0.9+';
99 }
100 if (empty($thisfile_bonk['BONK'])) {
101 unset($ThisFileInfo['bonk']);
102 }
103 return true;
104
105 }

References BonkIsValidTagName(), getid3_handler\fread(), getid3_handler\fseek(), getid3_handler\ftell(), HandleBonkTags(), and getid3_lib\LittleEndian2Int().

+ Here is the call graph for this function:

◆ HandleBonkTags() [1/2]

getid3_bonk::HandleBonkTags (   $BonkTagName)

Definition at line 117 of file module.audio.bonk.php.

117 {
118 $info = &$this->getid3->info;
119 switch ($BonkTagName) {
120 case 'BONK':
121 // shortcut
122 $thisfile_bonk_BONK = &$info['bonk']['BONK'];
123
124 $BonkData = "\x00".'BONK'.$this->fread(17);
125 $thisfile_bonk_BONK['version'] = getid3_lib::LittleEndian2Int(substr($BonkData, 5, 1));
126 $thisfile_bonk_BONK['number_samples'] = getid3_lib::LittleEndian2Int(substr($BonkData, 6, 4));
127 $thisfile_bonk_BONK['sample_rate'] = getid3_lib::LittleEndian2Int(substr($BonkData, 10, 4));
128
129 $thisfile_bonk_BONK['channels'] = getid3_lib::LittleEndian2Int(substr($BonkData, 14, 1));
130 $thisfile_bonk_BONK['lossless'] = (bool) getid3_lib::LittleEndian2Int(substr($BonkData, 15, 1));
131 $thisfile_bonk_BONK['joint_stereo'] = (bool) getid3_lib::LittleEndian2Int(substr($BonkData, 16, 1));
132 $thisfile_bonk_BONK['number_taps'] = getid3_lib::LittleEndian2Int(substr($BonkData, 17, 2));
133 $thisfile_bonk_BONK['downsampling_ratio'] = getid3_lib::LittleEndian2Int(substr($BonkData, 19, 1));
134 $thisfile_bonk_BONK['samples_per_packet'] = getid3_lib::LittleEndian2Int(substr($BonkData, 20, 2));
135
136 $info['avdataoffset'] = $thisfile_bonk_BONK['offset'] + 5 + 17;
137 $info['avdataend'] = $thisfile_bonk_BONK['offset'] + $thisfile_bonk_BONK['size'];
138
139 $info['fileformat'] = 'bonk';
140 $info['audio']['dataformat'] = 'bonk';
141 $info['audio']['bitrate_mode'] = 'vbr'; // assumed
142 $info['audio']['channels'] = $thisfile_bonk_BONK['channels'];
143 $info['audio']['sample_rate'] = $thisfile_bonk_BONK['sample_rate'];
144 $info['audio']['channelmode'] = ($thisfile_bonk_BONK['joint_stereo'] ? 'joint stereo' : 'stereo');
145 $info['audio']['lossless'] = $thisfile_bonk_BONK['lossless'];
146 $info['audio']['codec'] = 'bonk';
147
148 $info['playtime_seconds'] = $thisfile_bonk_BONK['number_samples'] / ($thisfile_bonk_BONK['sample_rate'] * $thisfile_bonk_BONK['channels']);
149 if ($info['playtime_seconds'] > 0) {
150 $info['audio']['bitrate'] = (($info['bonk']['dataend'] - $info['bonk']['dataoffset']) * 8) / $info['playtime_seconds'];
151 }
152 break;
153
154 case 'INFO':
155 // shortcut
156 $thisfile_bonk_INFO = &$info['bonk']['INFO'];
157
158 $thisfile_bonk_INFO['version'] = getid3_lib::LittleEndian2Int($this->fread(1));
159 $thisfile_bonk_INFO['entries_count'] = 0;
160 $NextInfoDataPair = $this->fread(5);
161 if (!$this->BonkIsValidTagName(substr($NextInfoDataPair, 1, 4))) {
162 while (!feof($this->getid3->fp)) {
163 //$CurrentSeekInfo['offset'] = getid3_lib::LittleEndian2Int(substr($NextInfoDataPair, 0, 4));
164 //$CurrentSeekInfo['nextbit'] = getid3_lib::LittleEndian2Int(substr($NextInfoDataPair, 4, 1));
165 //$thisfile_bonk_INFO[] = $CurrentSeekInfo;
166
167 $NextInfoDataPair = $this->fread(5);
168 if ($this->BonkIsValidTagName(substr($NextInfoDataPair, 1, 4))) {
169 $this->fseek(-5, SEEK_CUR);
170 break;
171 }
172 $thisfile_bonk_INFO['entries_count']++;
173 }
174 }
175 break;
176
177 case 'META':
178 $BonkData = "\x00".'META'.$this->fread($info['bonk']['META']['size'] - 5);
179 $info['bonk']['META']['version'] = getid3_lib::LittleEndian2Int(substr($BonkData, 5, 1));
180
181 $MetaTagEntries = floor(((strlen($BonkData) - 8) - 6) / 8); // BonkData - xxxxmeta - ØMETA
182 $offset = 6;
183 for ($i = 0; $i < $MetaTagEntries; $i++) {
184 $MetaEntryTagName = substr($BonkData, $offset, 4);
185 $offset += 4;
186 $MetaEntryTagOffset = getid3_lib::LittleEndian2Int(substr($BonkData, $offset, 4));
187 $offset += 4;
188 $info['bonk']['META']['tags'][$MetaEntryTagName] = $MetaEntryTagOffset;
189 }
190 break;
191
192 case ' ID3':
193 $info['audio']['encoder'] = 'Extended BONK v0.9+';
194
195 // ID3v2 checking is optional
196 if (class_exists('getid3_id3v2')) {
197 $getid3_temp = new getID3();
198 $getid3_temp->openfile($this->getid3->filename);
199 $getid3_id3v2 = new getid3_id3v2($getid3_temp);
200 $getid3_id3v2->StartingOffset = $info['bonk'][' ID3']['offset'] + 2;
201 $info['bonk'][' ID3']['valid'] = $getid3_id3v2->Analyze();
202 if ($info['bonk'][' ID3']['valid']) {
203 $info['id3v2'] = $getid3_temp->info['id3v2'];
204 }
205 unset($getid3_temp, $getid3_id3v2);
206 }
207 break;
208
209 default:
210 $info['warning'][] = 'Unexpected Bonk tag "'.$BonkTagName.'" at offset '.$info['bonk'][$BonkTagName]['offset'];
211 break;
212
213 }
214 }

References $info, BonkIsValidTagName(), getid3_handler\feof(), getid3_handler\fread(), getid3_handler\fseek(), and getid3_lib\LittleEndian2Int().

+ Here is the call graph for this function:

◆ HandleBonkTags() [2/2]

getid3_bonk::HandleBonkTags ( $fd,
$BonkTagName,
$ThisFileInfo 
)

Definition at line 107 of file module.audio.bonk.php.

107 {
108
109 switch ($BonkTagName) {
110 case 'BONK':
111 // shortcut
112 $thisfile_bonk_BONK = &$ThisFileInfo['bonk']['BONK'];
113
114 $BonkData = "\x00".'BONK'.fread($fd, 17);
115 $thisfile_bonk_BONK['version'] = getid3_lib::LittleEndian2Int(substr($BonkData, 5, 1));
116 $thisfile_bonk_BONK['number_samples'] = getid3_lib::LittleEndian2Int(substr($BonkData, 6, 4));
117 $thisfile_bonk_BONK['sample_rate'] = getid3_lib::LittleEndian2Int(substr($BonkData, 10, 4));
118
119 $thisfile_bonk_BONK['channels'] = getid3_lib::LittleEndian2Int(substr($BonkData, 14, 1));
120 $thisfile_bonk_BONK['lossless'] = (bool) getid3_lib::LittleEndian2Int(substr($BonkData, 15, 1));
121 $thisfile_bonk_BONK['joint_stereo'] = (bool) getid3_lib::LittleEndian2Int(substr($BonkData, 16, 1));
122 $thisfile_bonk_BONK['number_taps'] = getid3_lib::LittleEndian2Int(substr($BonkData, 17, 2));
123 $thisfile_bonk_BONK['downsampling_ratio'] = getid3_lib::LittleEndian2Int(substr($BonkData, 19, 1));
124 $thisfile_bonk_BONK['samples_per_packet'] = getid3_lib::LittleEndian2Int(substr($BonkData, 20, 2));
125
126 $ThisFileInfo['avdataoffset'] = $thisfile_bonk_BONK['offset'] + 5 + 17;
127 $ThisFileInfo['avdataend'] = $thisfile_bonk_BONK['offset'] + $thisfile_bonk_BONK['size'];
128
129 $ThisFileInfo['fileformat'] = 'bonk';
130 $ThisFileInfo['audio']['dataformat'] = 'bonk';
131 $ThisFileInfo['audio']['bitrate_mode'] = 'vbr'; // assumed
132 $ThisFileInfo['audio']['channels'] = $thisfile_bonk_BONK['channels'];
133 $ThisFileInfo['audio']['sample_rate'] = $thisfile_bonk_BONK['sample_rate'];
134 $ThisFileInfo['audio']['channelmode'] = ($thisfile_bonk_BONK['joint_stereo'] ? 'joint stereo' : 'stereo');
135 $ThisFileInfo['audio']['lossless'] = $thisfile_bonk_BONK['lossless'];
136 $ThisFileInfo['audio']['codec'] = 'bonk';
137
138 $ThisFileInfo['playtime_seconds'] = $thisfile_bonk_BONK['number_samples'] / ($thisfile_bonk_BONK['sample_rate'] * $thisfile_bonk_BONK['channels']);
139 if ($ThisFileInfo['playtime_seconds'] > 0) {
140 $ThisFileInfo['audio']['bitrate'] = (($ThisFileInfo['bonk']['dataend'] - $ThisFileInfo['bonk']['dataoffset']) * 8) / $ThisFileInfo['playtime_seconds'];
141 }
142 break;
143
144 case 'INFO':
145 // shortcut
146 $thisfile_bonk_INFO = &$ThisFileInfo['bonk']['INFO'];
147
148 $thisfile_bonk_INFO['version'] = getid3_lib::LittleEndian2Int(fread($fd, 1));
149 $thisfile_bonk_INFO['entries_count'] = 0;
150 $NextInfoDataPair = fread($fd, 5);
151 if (!$this->BonkIsValidTagName(substr($NextInfoDataPair, 1, 4))) {
152 while (!feof($fd)) {
153 //$CurrentSeekInfo['offset'] = getid3_lib::LittleEndian2Int(substr($NextInfoDataPair, 0, 4));
154 //$CurrentSeekInfo['nextbit'] = getid3_lib::LittleEndian2Int(substr($NextInfoDataPair, 4, 1));
155 //$thisfile_bonk_INFO[] = $CurrentSeekInfo;
156
157 $NextInfoDataPair = fread($fd, 5);
158 if ($this->BonkIsValidTagName(substr($NextInfoDataPair, 1, 4))) {
159 fseek($fd, -5, SEEK_CUR);
160 break;
161 }
162 $thisfile_bonk_INFO['entries_count']++;
163 }
164 }
165 break;
166
167 case 'META':
168 $BonkData = "\x00".'META'.fread($fd, $ThisFileInfo['bonk']['META']['size'] - 5);
169 $ThisFileInfo['bonk']['META']['version'] = getid3_lib::LittleEndian2Int(substr($BonkData, 5, 1));
170
171 $MetaTagEntries = floor(((strlen($BonkData) - 8) - 6) / 8); // BonkData - xxxxmeta - ØMETA
172 $offset = 6;
173 for ($i = 0; $i < $MetaTagEntries; $i++) {
174 $MetaEntryTagName = substr($BonkData, $offset, 4);
175 $offset += 4;
176 $MetaEntryTagOffset = getid3_lib::LittleEndian2Int(substr($BonkData, $offset, 4));
177 $offset += 4;
178 $ThisFileInfo['bonk']['META']['tags'][$MetaEntryTagName] = $MetaEntryTagOffset;
179 }
180 break;
181
182 case ' ID3':
183 $ThisFileInfo['audio']['encoder'] = 'Extended BONK v0.9+';
184
185 // ID3v2 checking is optional
186 if (class_exists('getid3_id3v2')) {
187 $ThisFileInfo['bonk'][' ID3']['valid'] = new getid3_id3v2($fd, $ThisFileInfo, $ThisFileInfo['bonk'][' ID3']['offset'] + 2);
188 }
189 break;
190
191 default:
192 $ThisFileInfo['warning'][] = 'Unexpected Bonk tag "'.$BonkTagName.'" at offset '.$ThisFileInfo['bonk'][$BonkTagName]['offset'];
193 break;
194
195 }
196 }

References BonkIsValidTagName(), getid3_handler\feof(), getid3_handler\fread(), getid3_handler\fseek(), and getid3_lib\LittleEndian2Int().

Referenced by Analyze(), and getid3_bonk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: