Просмотр файла download/class_mp3.php

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