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<?php
class getid3_mp3 extends getid3_handler
{
mpeg-audio streams
const VALID_CHECK_FRAMES = 35;
public function Analyze() {
$this->getAllMPEGInfo($this->getid3->fp, $this->getid3->info);
return true;
}
public function AnalyzeMPEGaudioInfo() {
$this->getOnlyMPEGaudioInfo($this->getid3->fp, $this->getid3->info, $this->getid3->info['avdataoffset'], false);
}
public function getAllMPEGInfo(&$fd, &$info) {
$this->getOnlyMPEGaudioInfo($fd, $info, 0 + $info['avdataoffset']);
if (isset($info['mpeg']['audio']['bitrate_mode'])) { $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); }
if (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0)))) {
$synch_offset_warning = 'Unknown data before synch ';
if (isset($info['id3v2']['headerlength'])) { $synch_offset_warning .= '(ID3v2 header ends at '.$info['id3v2']['headerlength'].', then '.($info['avdataoffset'] - $info['id3v2']['headerlength']).' bytes garbage, ';
} else {
$synch_offset_warning .= '(should be at beginning of file, ';
}
$synch_offset_warning .= 'synch detected at '.$info['avdataoffset'].')';
if ($info['audio']['bitrate_mode'] == 'cbr') {
if (!empty($info['id3v2']['headerlength']) && (($info['avdataoffset'] - $info['id3v2']['headerlength']) == $info['mpeg']['audio']['framelength'])) {
$synch_offset_warning .= '. This is a known problem with some versions of LAME (3.90-3.92) DLL in CBR mode.';
$info['audio']['codec'] = 'LAME';
$current_data_lame_version_string = 'LAME3.';
} elseif (empty($info['id3v2']['headerlength']) && ($info['avdataoffset'] == $info['mpeg']['audio']['framelength'])) {
$synch_offset_warning .= '. This is a known problem with some versions of LAME (3.90 - 3.92) DLL in CBR mode.';
$info['audio']['codec'] = 'LAME';
$current_data_lame_version_string = 'LAME3.';
}
}
$this->getid3->warning($synch_offset_warning);
}
if (isset($info['mpeg']['audio']['LAME'])) { $info['audio']['codec'] = 'LAME';
if (!empty($info['mpeg']['audio']['LAME']['long_version'])) { $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['long_version'], "\x00"); } elseif (!empty($info['mpeg']['audio']['LAME']['short_version'])) { $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['short_version'], "\x00"); }
}
esto es solo la una parte del codigo...