Просмотр файла moduls/id.php

Размер файла: 20.74Kb
  1. <?php
  2. require_once "pear.php" ;
  3. define('PEAR_MP3_ID_FNO', 1);
  4. define('PEAR_MP3_ID_RE', 2);
  5. define('PEAR_MP3_ID_TNF', 3);
  6. define('PEAR_MP3_ID_NOMP3', 4);
  7. class MP3_Id {
  8. var $file = false;
  9. var $id3v1 = false;
  10. var $id3v11 = false;
  11. var $id3v2 = false;
  12. var $name = '';
  13. var $artists = '';
  14. var $album = '';
  15. var $year = '';
  16. var $comment = '';
  17. var $track = 0;
  18. var $genre = '';
  19. var $genreno = 255;
  20. var $studied = false;
  21. var $mpeg_ver = 0;
  22. var $layer = 0;
  23. var $bitrate = 0;
  24. var $crc = false;
  25. var $frequency = 0;
  26. var $encoding_type = 0;
  27. var $samples_per_frame = 0;
  28. var $samples = 0;
  29. var $musicsize = -1;
  30. var $frames = 0;
  31. var $quality = 0;
  32. var $padding = false;
  33. var $private = false;
  34. var $mode = '';
  35. var $copyright = false;
  36. var $original = false;
  37. var $emphasis = '';
  38. var $filesize = -1;
  39. var $frameoffset = -1;
  40. var $lengthh = false;
  41. var $length = false;
  42. var $lengths = false;
  43. var $error = false;
  44. var $debug = false;
  45. var $debugbeg = '<DIV STYLE="margin: 0.5 em; padding: 0.5 em; border-width: thin; border-color: black; border-style: solid">';
  46. var $debugend = '</DIV>';
  47. function MP3_Id($study = false)
  48. {
  49. if(defined('ID3_SHOW_DEBUG')) $this->debug = true;
  50. $this->study=($study || defined('ID3_AUTO_STUDY'));
  51. }
  52. function read( $file="")
  53. {
  54. if ($this->debug) print($this->debugbeg . "id3('$file')<HR>\n");
  55.  
  56. if(!empty($file))$this->file = $file;
  57. if ($this->debug) print($this->debugend);
  58.  
  59. return $this->_read_v1();
  60. }
  61. function setTag($name, $value)
  62. {
  63. if( is_array($name))
  64. {
  65. foreach( $name as $n => $v)
  66. {
  67. $this -> $n = $v ;
  68. }
  69. }
  70. else
  71. {
  72. $this -> $name = $value ;
  73. }
  74. }
  75.  
  76. function getTag($name, $default = 0)
  77. {
  78. if(empty($this -> $name))
  79. {
  80. return $default ;
  81. }
  82. else
  83. {
  84. return $this -> $name ;
  85. }
  86. }
  87.  
  88. function write($v1 = true)
  89. {
  90. if ($this->debug) print($this->debugbeg . "write()<HR>\n");
  91. if ($v1)
  92. {
  93. $this->_write_v1();
  94. }
  95. if ($this->debug) print($this->debugend);
  96. }
  97.  
  98. function study()
  99. {
  100. $this->studied = true;
  101. $this->_readframe();
  102. }
  103.  
  104.  
  105. function copy($from)
  106. {
  107. if ($this->debug) print($this->debugbeg . "copy(\$from)<HR>\n");
  108. $this->name = $from->name;
  109. $this->artists = $from->artists;
  110. $this->album = $from->album;
  111. $this->year = $from->year;
  112. $this->comment = $from->comment;
  113. $this->track = $from->track;
  114. $this->genre = $from->genre;
  115. $this->genreno = $from->genreno;
  116. if ($this->debug) print($this->debugend);
  117. }
  118.  
  119. function remove($id3v1 = true, $id3v2 = true)
  120. {
  121. if ($this->debug) print($this->debugbeg . "remove()<HR>\n");
  122.  
  123. if ($id3v1)
  124. {
  125. $this->_remove_v1();
  126. }
  127.  
  128. if ($id3v2)
  129. {
  130.  
  131. }
  132.  
  133. if ($this->debug) print($this->debugend);
  134. }
  135.  
  136.  
  137. function _read_v1()
  138. {
  139. if ($this->debug) print($this->debugbeg . "_read_v1()<HR>\n");
  140.  
  141. $mqr = get_magic_quotes_runtime();
  142. set_magic_quotes_runtime(0);
  143.  
  144. if (! ($f = @fopen($this->file, 'rb')) ) {
  145. return PEAR::raiseError( "Unable to open " . $this->file, PEAR_MP3_ID_FNO);
  146. }
  147.  
  148. if (fseek($f, -128, SEEK_END) == -1) {
  149. return PEAR::raiseError( 'Unable to see to end - 128 of ' . $this->file, PEAR_MP3_ID_RE);
  150. }
  151.  
  152. $r = fread($f, 128);
  153. fclose($f);
  154. set_magic_quotes_runtime($mqr);
  155.  
  156. if ($this->debug) {
  157. $unp = unpack('H*raw', $r);
  158. print_r($unp);
  159. }
  160.  
  161. $id3tag = $this->_decode_v1($r);
  162.  
  163. if(!PEAR::isError( $id3tag)) {
  164. $this->id3v1 = true;
  165.  
  166. $tmp = explode(Chr(0), $id3tag['NAME']);
  167. $this->name = $tmp[0];
  168.  
  169. $tmp = explode(Chr(0), $id3tag['ARTISTS']);
  170. $this->artists = $tmp[0];
  171.  
  172. $tmp = explode(Chr(0), $id3tag['ALBUM']);
  173. $this->album = $tmp[0];
  174.  
  175. $tmp = explode(Chr(0), $id3tag['YEAR']);
  176. $this->year = $tmp[0];
  177.  
  178. $tmp = explode(Chr(0), $id3tag['COMMENT']);
  179. $this->comment = $tmp[0];
  180.  
  181. if (isset($id3tag['TRACK'])) {
  182. $this->id3v11 = true;
  183. $this->track = $id3tag['TRACK'];
  184. }
  185.  
  186. $this->genreno = $id3tag['GENRENO'];
  187. $this->genre = $id3tag['GENRE'];
  188. } else {
  189. return $id3tag ;
  190. }
  191.  
  192. if ($this->debug) print($this->debugend);
  193. }
  194.  
  195. function _decode_v1($rawtag) {
  196. if ($this->debug) print($this->debugbeg . "_decode_v1(\$rawtag)<HR>\n");
  197.  
  198. if ($rawtag[125] == Chr(0) and $rawtag[126] != Chr(0)) {
  199.  
  200. $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a28COMMENT/x1/C1TRACK/C1GENRENO';
  201. } else {
  202.  
  203. $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a30COMMENT/C1GENRENO';
  204. }
  205.  
  206. $id3tag = unpack($format, $rawtag);
  207. if ($this->debug) print_r($id3tag);
  208.  
  209. if ($id3tag['TAG'] == 'TAG') {
  210. $id3tag['GENRE'] = $this->getgenre($id3tag['GENRENO']);
  211. } else {
  212. $id3tag = PEAR::raiseError( 'TAG not found', PEAR_MP3_ID_TNF);
  213. }
  214. if ($this->debug) print($this->debugend);
  215. return $id3tag;
  216. }
  217.  
  218. function _write_v1() {
  219. if ($this->debug) print($this->debugbeg . "_write_v1()<HR>\n");
  220.  
  221. $file = $this->file;
  222.  
  223. if (! ($f = @fopen($file, 'r+b')) ) {
  224. return PEAR::raiseError( "Unable to open " . $file, PEAR_MP3_ID_FNO);
  225. }
  226.  
  227. if (fseek($f, -128, SEEK_END) == -1) {
  228. return PEAR::raiseError( "Unable to see to end - 128 of " . $file, PEAR_MP3_ID_RE);
  229. }
  230.  
  231. $this->genreno = $this->getgenreno($this->genre, $this->genreno);
  232.  
  233. $newtag = $this->_encode_v1();
  234.  
  235. $mqr = get_magic_quotes_runtime();
  236. set_magic_quotes_runtime(0);
  237.  
  238. $r = fread($f, 128);
  239.  
  240. if ( !PEAR::isError( $this->_decode_v1($r))) {
  241. if (fseek($f, -128, SEEK_END) == -1) {
  242. return PEAR::raiseError( "Unable to see to end - 128 of " . $file, PEAR_MP3_ID_RE);
  243. }
  244. fwrite($f, $newtag);
  245. } else {
  246. if (fseek($f, 0, SEEK_END) == -1) {
  247. return PEAR::raiseError( "Unable to see to end of " . $file, PEAR_MP3_ID_RE);
  248. }
  249. fwrite($f, $newtag);
  250. }
  251. fclose($f);
  252. set_magic_quotes_runtime($mqr);
  253.  
  254. if ($this->debug) print($this->debugend);
  255. }
  256.  
  257. function _encode_v1() {
  258. if ($this->debug) print($this->debugbeg . "_encode_v1()<HR>\n");
  259.  
  260. if ($this->track) {
  261. $id3pack = 'a3a30a30a30a4a28x1C1C1';
  262. $newtag = pack($id3pack,
  263. 'TAG',
  264. $this->name,
  265. $this->artists,
  266. $this->album,
  267. $this->year,
  268. $this->comment,
  269. $this->track,
  270. $this->genreno
  271. );
  272. } else {
  273. $id3pack = 'a3a30a30a30a4a30C1';
  274. $newtag = pack($id3pack,
  275. 'TAG',
  276. $this->name,
  277. $this->artists,
  278. $this->album,
  279. $this->year,
  280. $this->comment,
  281. $this->genreno
  282. );
  283. }
  284.  
  285. if ($this->debug) {
  286. print('id3pack: ' . $id3pack . "\n");
  287. $unp = unpack('H*new', $newtag);
  288. print_r($unp);
  289. }
  290.  
  291. if ($this->debug) print($this->debugend);
  292. return $newtag;
  293. }
  294.  
  295. function _remove_v1() {
  296. if ($this->debug) print($this->debugbeg . "_remove_v1()<HR>\n");
  297.  
  298. $file = $this->file;
  299.  
  300. if (! ($f = fopen($file, 'r+b')) ) {
  301. return PEAR::raiseError( "Unable to open " . $file, PEAR_MP3_ID_FNO);
  302. }
  303.  
  304. if (fseek($f, -128, SEEK_END) == -1) {
  305. return PEAR::raiseError( 'Unable to see to end - 128 of ' . $file, PEAR_MP3_ID_RE);
  306. }
  307.  
  308. $mqr = get_magic_quotes_runtime();
  309. set_magic_quotes_runtime(0);
  310.  
  311. $r = fread($f, 128);
  312.  
  313. $success = false;
  314. if ( !PEAR::isError( $this->_decode_v1($r))) {
  315. $size = filesize($this->file) - 128;
  316. if ($this->debug) print('size: old: ' . filesize($this->file));
  317. $success = ftruncate($f, $size);
  318. clearstatcache();
  319. if ($this->debug) print(' new: ' . filesize($this->file));
  320. }
  321. fclose($f);
  322. set_magic_quotes_runtime($mqr);
  323.  
  324. if ($this->debug) print($this->debugend);
  325. return $success;
  326. }
  327.  
  328. function _readframe() {
  329. if ($this->debug) print($this->debugbeg . "_readframe()<HR>\n");
  330.  
  331. $file = $this->file;
  332.  
  333. $mqr = get_magic_quotes_runtime();
  334. set_magic_quotes_runtime(0);
  335.  
  336. if (! ($f = fopen($file, 'rb')) ) {
  337. if ($this->debug) print($this->debugend);
  338. return PEAR::raiseError( "Unable to open " . $file, PEAR_MP3_ID_FNO) ;
  339. }
  340.  
  341. $this->filesize = filesize($file);
  342.  
  343. do {
  344. while (fread($f,1) != Chr(255)) {
  345. if ($this->debug) echo "Find...\n";
  346. if (feof($f)) {
  347. if ($this->debug) print($this->debugend);
  348. return PEAR::raiseError( "No mpeg frame found", PEAR_MP3_ID_NOMP3) ;
  349. }
  350. }
  351. fseek($f, ftell($f) - 1);
  352.  
  353. $frameoffset = ftell($f);
  354.  
  355. $r = fread($f, 4);
  356. $bits = sprintf("%'08b%'08b%'08b%'08b", ord($r{0}), ord($r{1}), ord($r{2}), ord($r{3}));
  357. } while (!$bits[8] and !$bits[9] and !$bits[10]);
  358. if ($this->debug) print('Bits: ' . $bits . "\n");
  359.  
  360. $this->frameoffset = $frameoffset;
  361.  
  362. if ($bits[11] == 0) {
  363. if (($bits[24] == 1) && ($bits[25] == 1)) {
  364. $vbroffset = 9;
  365. } else {
  366. $vbroffset = 17;
  367. }
  368. } else if ($bits[12] == 0) {
  369. if (($bits[24] == 1) && ($bits[25] == 1)) {
  370. $vbroffset = 9;
  371. } else {
  372. $vbroffset = 17;
  373. }
  374. } else {
  375. if (($bits[24] == 1) && ($bits[25] == 1)) {
  376. $vbroffset = 17;
  377. } else {
  378. $vbroffset = 32;
  379. }
  380. }
  381.  
  382. fseek($f, ftell($f) + $vbroffset);
  383. $r = fread($f, 4);
  384.  
  385. switch ($r) {
  386. case 'Xing':
  387. $this->encoding_type = 'VBR';
  388. case 'Info':
  389.  
  390. if ($this->debug) print('Encoding Header: ' . $r . "\n");
  391.  
  392. $r = fread($f, 4);
  393. $vbrbits = sprintf("%'08b", ord($r{3}));
  394.  
  395. if ($this->debug) print('XING Header Bits: ' . $vbrbits . "\n");
  396.  
  397. if ($vbrbits[7] == 1) {
  398. $r = fread($f, 4);
  399. $this->frames = unpack('N', $r);
  400. $this->frames = $this->frames[1];
  401. }
  402.  
  403. if ($vbrbits[6] == 1) {
  404. $r = fread($f, 4);
  405. $this->musicsize = unpack('N', $r);
  406. $this->musicsize = $this->musicsize[1];
  407. }
  408.  
  409. if ($vbrbits[5] == 1) {
  410. fseek($f, ftell($f) + 100);
  411. }
  412.  
  413. if ($vbrbits[4] == 1) {
  414. $r = fread($f, 4);
  415. $this->quality = unpack('N', $r);
  416. $this->quality = $this->quality[1];
  417. }
  418.  
  419. break;
  420.  
  421. case 'VBRI':
  422. default:
  423. if ($vbroffset != 32) {
  424. fseek($f, ftell($f) + 32 - $vbroffset);
  425. $r = fread($f, 4);
  426.  
  427. if ($r != 'VBRI') {
  428. $this->encoding_type = 'CBR';
  429. break;
  430. }
  431. } else {
  432. $this->encoding_type = 'CBR';
  433. break;
  434. }
  435.  
  436. if ($this->debug) print('Encoding Header: ' . $r . "\n");
  437.  
  438. $this->encoding_type = 'VBR';
  439.  
  440. fseek($f, ftell($f) + 2);
  441.  
  442. fseek($f, ftell($f) + 2);
  443.  
  444. $r = fread($f, 2);
  445. $this->quality = unpack('n', $r);
  446. $this->quality = $this->quality[1];
  447.  
  448. $r = fread($f, 4);
  449. $this->musicsize = unpack('N', $r);
  450. $this->musicsize = $this->musicsize[1];
  451.  
  452.  
  453. $r = fread($f, 4);
  454. $this->frames = unpack('N', $r);
  455. $this->frames = $this->frames[1];
  456. }
  457.  
  458. fclose($f);
  459. set_magic_quotes_runtime($mqr);
  460.  
  461. if ($bits[11] == 0) {
  462. $this->mpeg_ver = "2.5";
  463. $bitrates = array(
  464. '1' => array(0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0),
  465. '2' => array(0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0),
  466. '3' => array(0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0),
  467. );
  468. } else if ($bits[12] == 0) {
  469. $this->mpeg_ver = "2";
  470. $bitrates = array(
  471. '1' => array(0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0),
  472. '2' => array(0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0),
  473. '3' => array(0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0),
  474. );
  475. } else {
  476. $this->mpeg_ver = "1";
  477. $bitrates = array(
  478. '1' => array(0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0),
  479. '2' => array(0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0),
  480. '3' => array(0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0),
  481. );
  482. }
  483. if ($this->debug) print('MPEG' . $this->mpeg_ver . "\n");
  484.  
  485. $layer = array(
  486. array(0,3),
  487. array(2,1),
  488. );
  489. $this->layer = $layer[$bits[13]][$bits[14]];
  490. if ($this->debug) print('layer: ' . $this->layer . "\n");
  491.  
  492. if ($bits[15] == 0) {
  493. if ($this->debug) print("protected (crc)\n");
  494. $this->crc = true;
  495. }
  496.  
  497. $bitrate = 0;
  498. if ($bits[16] == 1) $bitrate += 8;
  499. if ($bits[17] == 1) $bitrate += 4;
  500. if ($bits[18] == 1) $bitrate += 2;
  501. if ($bits[19] == 1) $bitrate += 1;
  502. $this->bitrate = $bitrates[$this->layer][$bitrate];
  503.  
  504. $frequency = array(
  505. '1' => array(
  506. '0' => array(44100, 48000),
  507. '1' => array(32000, 0),
  508. ),
  509. '2' => array(
  510. '0' => array(22050, 24000),
  511. '1' => array(16000, 0),
  512. ),
  513. '2.5' => array(
  514. '0' => array(11025, 12000),
  515. '1' => array(8000, 0),
  516. ),
  517. );
  518. $this->frequency = $frequency[$this->mpeg_ver][$bits[20]][$bits[21]];
  519.  
  520. $this->padding = $bits[22];
  521. $this->private = $bits[23];
  522.  
  523. $mode = array(
  524. array('Stereo', 'Joint Stereo'),
  525. array('Dual Channel', 'Mono'),
  526. );
  527. $this->mode = $mode[$bits[24]][$bits[25]];
  528.  
  529. $this->copyright = $bits[28];
  530. $this->original = $bits[29];
  531.  
  532. $emphasis = array(
  533. array('none', '50/15ms'),
  534. array('', 'CCITT j.17'),
  535. );
  536. $this->emphasis = $emphasis[$bits[30]][$bits[31]];
  537.  
  538. $samplesperframe = array(
  539. '1' => array(
  540. '1' => 384,
  541. '2' => 1152,
  542. '3' => 1152
  543. ),
  544. '2' => array(
  545. '1' => 384,
  546. '2' => 1152,
  547. '3' => 576
  548. ),
  549. '2.5' => array(
  550. '1' => 384,
  551. '2' => 1152,
  552. '3' => 576
  553. ),
  554. );
  555. $this->samples_per_frame = $samplesperframe[$this->mpeg_ver][$this->layer];
  556.  
  557. if ($this->encoding_type != 'VBR') {
  558. if ($this->bitrate == 0) {
  559. $s = -1;
  560. } else {
  561. $s = ((8*filesize($this->file))/1000) / $this->bitrate;
  562. }
  563. $this->length = sprintf('%02d:%02d',floor($s/60),floor($s-(floor($s/60)*60)));
  564. $this->lengthh = sprintf('%02d:%02d:%02d',floor($s/3600),floor($s/60),floor($s-(floor($s/60)*60)));
  565. $this->lengths = (int)$s;
  566.  
  567. $this->samples = ceil($this->lengths * $this->frequency);
  568. if(0 != $this->samples_per_frame) {
  569. $this->frames = ceil($this->samples / $this->samples_per_frame);
  570. } else {
  571. $this->frames = 0;
  572. }
  573. $this->musicsize = ceil($this->lengths * $this->bitrate * 1000 / 8);
  574. } else {
  575. $this->samples = $this->samples_per_frame * $this->frames;
  576. $s = $this->samples / $this->frequency;
  577.  
  578. $this->length = sprintf('%02d:%02d',floor($s/60),floor($s-(floor($s/60)*60)));
  579. $this->lengthh = sprintf('%02d:%02d:%02d',floor($s/3600),floor($s/60),floor($s-(floor($s/60)*60)));
  580. $this->lengths = (int)$s;
  581.  
  582. $this->bitrate = (int)(($this->musicsize / $s) * 8 / 1000);
  583. }
  584.  
  585. if ($this->debug) print($this->debugend);
  586. }
  587.  
  588. function getGenre($genreno) {
  589. if ($this->debug) print($this->debugbeg . "getgenre($genreno)<HR>\n");
  590.  
  591. $genres = $this->genres();
  592. if (isset($genres[$genreno])) {
  593. $genre = $genres[$genreno];
  594. if ($this->debug) print($genre . "\n");
  595. } else {
  596. $genre = '';
  597. }
  598.  
  599. if ($this->debug) print($this->debugend);
  600. return $genre;
  601. }
  602.  
  603. function getGenreNo($genre, $default = 0xff) {
  604. if ($this->debug) print($this->debugbeg . "getgenreno('$genre',$default)<HR>\n");
  605.  
  606. $genres = $this->genres();
  607. $genreno = false;
  608. if ($genre) {
  609. foreach ($genres as $no => $name) {
  610. if (strtolower($genre) == strtolower($name)) {
  611. if ($this->debug) print("$no:'$name' == '$genre'");
  612. $genreno = $no;
  613. }
  614. }
  615. }
  616. if ($genreno === false) $genreno = $default;
  617. if ($this->debug) print($this->debugend);
  618. return $genreno;
  619. }
  620.  
  621. function genres() {
  622. return array(
  623. 0 => 'Blues',
  624. 1 => 'Classic Rock',
  625. 2 => 'Country',
  626. 3 => 'Dance',
  627. 4 => 'Disco',
  628. 5 => 'Funk',
  629. 6 => 'Grunge',
  630. 7 => 'Hip-Hop',
  631. 8 => 'Jazz',
  632. 9 => 'Metal',
  633. 10 => 'New Age',
  634. 11 => 'Oldies',
  635. 12 => 'Other',
  636. 13 => 'Pop',
  637. 14 => 'R&B',
  638. 15 => 'Rap',
  639. 16 => 'Reggae',
  640. 17 => 'Rock',
  641. 18 => 'Techno',
  642. 19 => 'Industrial',
  643. 20 => 'Alternative',
  644. 21 => 'Ska',
  645. 22 => 'Death Metal',
  646. 23 => 'Pranks',
  647. 24 => 'Soundtrack',
  648. 25 => 'Euro-Techno',
  649. 26 => 'Ambient',
  650. 27 => 'Trip-Hop',
  651. 28 => 'Vocal',
  652. 29 => 'Jazz+Funk',
  653. 30 => 'Fusion',
  654. 31 => 'Trance',
  655. 32 => 'Classical',
  656. 33 => 'Instrumental',
  657. 34 => 'Acid',
  658. 35 => 'House',
  659. 36 => 'Game',
  660. 37 => 'Sound Clip',
  661. 38 => 'Gospel',
  662. 39 => 'Noise',
  663. 40 => 'Alternative Rock',
  664. 41 => 'Bass',
  665. 42 => 'Soul',
  666. 43 => 'Punk',
  667. 44 => 'Space',
  668. 45 => 'Meditative',
  669. 46 => 'Instrumental Pop',
  670. 47 => 'Instrumental Rock',
  671. 48 => 'Ethnic',
  672. 49 => 'Gothic',
  673. 50 => 'Darkwave',
  674. 51 => 'Techno-Industrial',
  675. 52 => 'Electronic',
  676. 53 => 'Pop-Folk',
  677. 54 => 'Eurodance',
  678. 55 => 'Dream',
  679. 56 => 'Southern Rock',
  680. 57 => 'Comedy',
  681. 58 => 'Cult',
  682. 59 => 'Gangsta',
  683. 60 => 'Top 40',
  684. 61 => 'Christian Rap',
  685. 62 => 'Pop/Funk',
  686. 63 => 'Jungle',
  687. 64 => 'Native US',
  688. 65 => 'Cabaret',
  689. 66 => 'New Wave',
  690. 67 => 'Psychadelic',
  691. 68 => 'Rave',
  692. 69 => 'Showtunes',
  693. 70 => 'Trailer',
  694. 71 => 'Lo-Fi',
  695. 72 => 'Tribal',
  696. 73 => 'Acid Punk',
  697. 74 => 'Acid Jazz',
  698. 75 => 'Polka',
  699. 76 => 'Retro',
  700. 77 => 'Musical',
  701. 78 => 'Rock & Roll',
  702. 79 => 'Hard Rock',
  703. 80 => 'Folk',
  704. 81 => 'Folk-Rock',
  705. 82 => 'National Folk',
  706. 83 => 'Swing',
  707. 84 => 'Fast Fusion',
  708. 85 => 'Bebob',
  709. 86 => 'Latin',
  710. 87 => 'Revival',
  711. 88 => 'Celtic',
  712. 89 => 'Bluegrass',
  713. 90 => 'Avantgarde',
  714. 91 => 'Gothic Rock',
  715. 92 => 'Progressive Rock',
  716. 93 => 'Psychedelic Rock',
  717. 94 => 'Symphonic Rock',
  718. 95 => 'Slow Rock',
  719. 96 => 'Big Band',
  720. 97 => 'Chorus',
  721. 98 => 'Easy Listening',
  722. 99 => 'Acoustic',
  723. 100 => 'Humour',
  724. 101 => 'Speech',
  725. 102 => 'Chanson',
  726. 103 => 'Opera',
  727. 104 => 'Chamber Music',
  728. 105 => 'Sonata',
  729. 106 => 'Symphony',
  730. 107 => 'Booty Bass',
  731. 108 => 'Primus',
  732. 109 => 'Porn Groove',
  733. 110 => 'Satire',
  734. 111 => 'Slow Jam',
  735. 112 => 'Club',
  736. 113 => 'Tango',
  737. 114 => 'Samba',
  738. 115 => 'Folklore',
  739. 116 => 'Ballad',
  740. 117 => 'Power Ballad',
  741. 118 => 'Rhytmic Soul',
  742. 119 => 'Freestyle',
  743. 120 => 'Duet',
  744. 121 => 'Punk Rock',
  745. 122 => 'Drum Solo',
  746. 123 => 'Acapella',
  747. 124 => 'Euro-House',
  748. 125 => 'Dance Hall',
  749. 126 => 'Goa',
  750. 127 => 'Drum & Bass',
  751. 128 => 'Club-House',
  752. 129 => 'Hardcore',
  753. 130 => 'Terror',
  754. 131 => 'Indie',
  755. 132 => 'BritPop',
  756. 133 => 'Negerpunk',
  757. 134 => 'Polsk Punk',
  758. 135 => 'Beat',
  759. 136 => 'Christian Gangsta Rap',
  760. 137 => 'Heavy Metal',
  761. 138 => 'Black Metal',
  762. 139 => 'Crossover',
  763. 140 => 'Contemporary Christian',
  764. 141 => 'Christian Rock',
  765. 142 => 'Merengue',
  766. 143 => 'Salsa',
  767. 144 => 'Trash Metal',
  768. 145 => 'Anime',
  769. 146 => 'Jpop',
  770. 147 => 'Synthpop'
  771. );
  772. }
  773. }
  774.  
  775. ?>