コード例 #1
0
 public static function samplelookup(&$mp3)
 {
     //bits               MPEG1   MPEG2   MPEG2.5
     $array = array();
     $array['00'] = array('44100', '22050', '11025');
     $array['01'] = array('48000', '24000', '12000');
     $array['10'] = array('32000', '16000', '8000');
     $array['11'] = array('res', 'res', 'res');
     $whichcolumn = -1;
     if (mp3file::is_mpeg10($mp3)) {
         $whichcolumn = 0;
     } else {
         if (mp3file::is_mpeg20($mp3)) {
             $whichcolumn = 1;
         } else {
             if (mp3file::is_mpeg25($mp3)) {
                 $whichcolumn = 2;
             }
         }
     }
     if (isset($array[$mp3['Sampling Freq Idx']][$whichcolumn])) {
         return $array[$mp3['Sampling Freq Idx']][$whichcolumn];
     } else {
         return 'unknown';
     }
 }