29 if (!getid3_lib::intValueSupported($info['filesize'])) { |
29 if (!getid3_lib::intValueSupported($info['filesize'])) { |
30 $this->warning('Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); |
30 $this->warning('Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); |
31 return false; |
31 return false; |
32 } |
32 } |
33 |
33 |
34 $this->fseek(-256, SEEK_END); |
34 if($info['filesize'] < 256) { |
35 $preid3v1 = $this->fread(128); |
35 $this->fseek(-128, SEEK_END); |
36 $id3v1tag = $this->fread(128); |
36 $preid3v1 = ''; |
|
37 $id3v1tag = $this->fread(128); |
|
38 } else { |
|
39 $this->fseek(-256, SEEK_END); |
|
40 $preid3v1 = $this->fread(128); |
|
41 $id3v1tag = $this->fread(128); |
|
42 } |
|
43 |
37 |
44 |
38 if (substr($id3v1tag, 0, 3) == 'TAG') { |
45 if (substr($id3v1tag, 0, 3) == 'TAG') { |
39 |
46 |
40 $info['avdataend'] = $info['filesize'] - 128; |
47 $info['avdataend'] = $info['filesize'] - 128; |
41 |
48 |
|
49 $ParsedID3v1 = array(); |
42 $ParsedID3v1['title'] = $this->cutfield(substr($id3v1tag, 3, 30)); |
50 $ParsedID3v1['title'] = $this->cutfield(substr($id3v1tag, 3, 30)); |
43 $ParsedID3v1['artist'] = $this->cutfield(substr($id3v1tag, 33, 30)); |
51 $ParsedID3v1['artist'] = $this->cutfield(substr($id3v1tag, 33, 30)); |
44 $ParsedID3v1['album'] = $this->cutfield(substr($id3v1tag, 63, 30)); |
52 $ParsedID3v1['album'] = $this->cutfield(substr($id3v1tag, 63, 30)); |
45 $ParsedID3v1['year'] = $this->cutfield(substr($id3v1tag, 93, 4)); |
53 $ParsedID3v1['year'] = $this->cutfield(substr($id3v1tag, 93, 4)); |
46 $ParsedID3v1['comment'] = substr($id3v1tag, 97, 30); // can't remove nulls yet, track detection depends on them |
54 $ParsedID3v1['comment'] = substr($id3v1tag, 97, 30); // can't remove nulls yet, track detection depends on them |
295 143 => 'Salsa', |
303 143 => 'Salsa', |
296 144 => 'Thrash Metal', |
304 144 => 'Thrash Metal', |
297 145 => 'Anime', |
305 145 => 'Anime', |
298 146 => 'JPop', |
306 146 => 'JPop', |
299 147 => 'Synthpop', |
307 147 => 'Synthpop', |
|
308 148 => 'Abstract', |
|
309 149 => 'Art Rock', |
|
310 150 => 'Baroque', |
|
311 151 => 'Bhangra', |
|
312 152 => 'Big Beat', |
|
313 153 => 'Breakbeat', |
|
314 154 => 'Chillout', |
|
315 155 => 'Downtempo', |
|
316 156 => 'Dub', |
|
317 157 => 'EBM', |
|
318 158 => 'Eclectic', |
|
319 159 => 'Electro', |
|
320 160 => 'Electroclash', |
|
321 161 => 'Emo', |
|
322 162 => 'Experimental', |
|
323 163 => 'Garage', |
|
324 164 => 'Global', |
|
325 165 => 'IDM', |
|
326 166 => 'Illbient', |
|
327 167 => 'Industro-Goth', |
|
328 168 => 'Jam Band', |
|
329 169 => 'Krautrock', |
|
330 170 => 'Leftfield', |
|
331 171 => 'Lounge', |
|
332 172 => 'Math Rock', |
|
333 173 => 'New Romantic', |
|
334 174 => 'Nu-Breakz', |
|
335 175 => 'Post-Punk', |
|
336 176 => 'Post-Rock', |
|
337 177 => 'Psytrance', |
|
338 178 => 'Shoegaze', |
|
339 179 => 'Space Rock', |
|
340 180 => 'Trop Rock', |
|
341 181 => 'World Music', |
|
342 182 => 'Neoclassical', |
|
343 183 => 'Audiobook', |
|
344 184 => 'Audio Theatre', |
|
345 185 => 'Neue Deutsche Welle', |
|
346 186 => 'Podcast', |
|
347 187 => 'Indie-Rock', |
|
348 188 => 'G-Funk', |
|
349 189 => 'Dubstep', |
|
350 190 => 'Garage Rock', |
|
351 191 => 'Psybient', |
300 |
352 |
301 255 => 'Unknown', |
353 255 => 'Unknown', |
302 |
354 |
303 'CR' => 'Cover', |
355 'CR' => 'Cover', |
304 'RX' => 'Remix' |
356 'RX' => 'Remix' |