Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/12/2010, 01:34
Ojete
 
Fecha de Ingreso: agosto-2010
Ubicación: Oakland california
Mensajes: 393
Antigüedad: 13 años, 9 meses
Puntos: 3
como se usa esta clase o funcion o las 2 cosas juntas???

se supone que esta clase es para sacar la informacion de un archivo mp3 pero no se como usarla, alguin podria explicarme??? Gracias..


Código PHP:
Ver original
  1. <?php
  2.  
  3.  
  4.  
  5. class getid3_mp3 extends getid3_handler
  6. {
  7.      mpeg-audio streams
  8.     const VALID_CHECK_FRAMES = 35;
  9.  
  10.  
  11.     public function Analyze() {
  12.  
  13.         $this->getAllMPEGInfo($this->getid3->fp, $this->getid3->info);
  14.  
  15.         return true;
  16.     }
  17.  
  18.  
  19.     public function AnalyzeMPEGaudioInfo() {
  20.  
  21.         $this->getOnlyMPEGaudioInfo($this->getid3->fp, $this->getid3->info, $this->getid3->info['avdataoffset'], false);
  22.     }
  23.  
  24.  
  25.     public function getAllMPEGInfo(&$fd, &$info) {
  26.  
  27.         $this->getOnlyMPEGaudioInfo($fd, $info, 0 + $info['avdataoffset']);
  28.  
  29.         if (isset($info['mpeg']['audio']['bitrate_mode'])) {
  30.             $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);
  31.         }
  32.  
  33.         if (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0)))) {
  34.  
  35.             $synch_offset_warning = 'Unknown data before synch ';
  36.             if (isset($info['id3v2']['headerlength'])) {
  37.                 $synch_offset_warning .= '(ID3v2 header ends at '.$info['id3v2']['headerlength'].', then '.($info['avdataoffset'] - $info['id3v2']['headerlength']).' bytes garbage, ';
  38.             } else {
  39.                 $synch_offset_warning .= '(should be at beginning of file, ';
  40.             }
  41.             $synch_offset_warning .= 'synch detected at '.$info['avdataoffset'].')';
  42.             if ($info['audio']['bitrate_mode'] == 'cbr') {
  43.  
  44.                 if (!empty($info['id3v2']['headerlength']) && (($info['avdataoffset'] - $info['id3v2']['headerlength']) == $info['mpeg']['audio']['framelength'])) {
  45.  
  46.                     $synch_offset_warning .= '. This is a known problem with some versions of LAME (3.90-3.92) DLL in CBR mode.';
  47.                     $info['audio']['codec'] = 'LAME';
  48.                     $current_data_lame_version_string = 'LAME3.';
  49.  
  50.                 } elseif (empty($info['id3v2']['headerlength']) && ($info['avdataoffset'] == $info['mpeg']['audio']['framelength'])) {
  51.  
  52.                     $synch_offset_warning .= '. This is a known problem with some versions of LAME (3.90 - 3.92) DLL in CBR mode.';
  53.                     $info['audio']['codec'] = 'LAME';
  54.                     $current_data_lame_version_string = 'LAME3.';
  55.  
  56.                 }
  57.  
  58.             }
  59.             $this->getid3->warning($synch_offset_warning);
  60.  
  61.         }
  62.  
  63.         if (isset($info['mpeg']['audio']['LAME'])) {
  64.             $info['audio']['codec'] = 'LAME';
  65.             if (!empty($info['mpeg']['audio']['LAME']['long_version'])) {
  66.                 $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['long_version'], "\x00");
  67.             } elseif (!empty($info['mpeg']['audio']['LAME']['short_version'])) {
  68.                 $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['short_version'], "\x00");
  69.             }
  70.         }
esto es solo la una parte del codigo...