openfile example


                break;

            case 'CDXA':
                $info['fileformat'] = 'vcd'; // Asume Video CD                 $info['mime_type']  = 'video/mpeg';

                if (!empty($thisfile_riff['CDXA']['data'][0]['size'])) {
                    getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.mpeg.php', __FILE__, true);

                    $getid3_temp = new getID3();
                    $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize']$this->getid3->fp);
                    $getid3_mpeg = new getid3_mpeg($getid3_temp);
                    $getid3_mpeg->Analyze();
                    if (empty($getid3_temp->info['error'])) {
                        $info['audio']   = $getid3_temp->info['audio'];
                        $info['video']   = $getid3_temp->info['video'];
                        $info['mpeg']    = $getid3_temp->info['mpeg'];
                        $info['warning'] = $getid3_temp->info['warning'];
                    }
                    unset($getid3_temp$getid3_mpeg);
                }
                break;

            


        if (isset($lyrics3offset) && isset($lyrics3version) && isset($lyrics3size)) {
            $info['avdataend'] = $lyrics3offset;
            $this->getLyrics3Data($lyrics3offset$lyrics3version$lyrics3size);

            if (!isset($info['ape'])) {
                if (isset($info['lyrics3']['tag_offset_start'])) {
                    $GETID3_ERRORARRAY = &$info['warning'];
                    getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
                    $getid3_temp = new getID3();
                    $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize']$this->getid3->fp);
                    $getid3_apetag = new getid3_apetag($getid3_temp);
                    $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
                    $getid3_apetag->Analyze();
                    if (!empty($getid3_temp->info['ape'])) {
                        $info['ape'] = $getid3_temp->info['ape'];
                    }
                    if (!empty($getid3_temp->info['replay_gain'])) {
                        $info['replay_gain'] = $getid3_temp->info['replay_gain'];
                    }
                    unset($getid3_temp$getid3_apetag);
                } else {
                    
$module_dataformat = ($track_info['dataformat'] == 'mp2' ? 'mp3' : ($track_info['dataformat'] == 'eac3' ? 'ac3' : $track_info['dataformat']));
                                getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.'.$module_dataformat.'.php', __FILE__, true);

                                if (!isset($info['matroska']['track_data_offsets'][$trackarray['TrackNumber']])) {
                                    $this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because $info[matroska][track_data_offsets]['.$trackarray['TrackNumber'].'] not set');
                                    break;
                                }

                                // create temp instance                                 $getid3_temp = new getID3();
                                if ($track_info['dataformat'] != 'flac') {
                                    $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize']$this->getid3->fp);
                                }
                                $getid3_temp->info['avdataoffset'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'];
                                if ($track_info['dataformat'][0] == 'm' || $track_info['dataformat'] == 'flac') {
                                    $getid3_temp->info['avdataend'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'] + $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['length'];
                                }

                                // analyze                                 $class = 'getid3_'.$module_dataformat;
                                $header_data_key = $track_info['dataformat'][0] == 'm' ? 'mpeg' : $track_info['dataformat'];
                                $getid3_audio = new $class($getid3_temp, __CLASS__);
                                if ($track_info['dataformat'] == 'flac') {
                                    
                                $mdat_offset += 12;
                            }
                    }

                    if (($atomsize > 8) && (!isset($info['avdataend_tmp']) || ($info['quicktime'][$atomname]['size'] > ($info['avdataend_tmp'] - $info['avdataoffset'])))) {

                        $info['avdataoffset'] = $atom_structure['offset'] + 8;                       // $info['quicktime'][$atomname]['offset'] + 8;                         $OldAVDataEnd         = $info['avdataend'];
                        $info['avdataend']    = $atom_structure['offset'] + $atom_structure['size']; // $info['quicktime'][$atomname]['offset'] + $info['quicktime'][$atomname]['size'];
                        $getid3_temp = new getID3();
                        $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize']$this->getid3->fp);
                        $getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
                        $getid3_temp->info['avdataend']    = $info['avdataend'];
                        $getid3_mp3 = new getid3_mp3($getid3_temp);
                        if ($getid3_mp3->MPEGaudioHeaderValid($getid3_mp3->MPEGaudioHeaderDecode($this->fread(4)))) {
                            $getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false);
                            if (!empty($getid3_temp->info['warning'])) {
                                foreach ($getid3_temp->info['warning'] as $value) {
                                    $this->warning($value);
                                }
                            }
                            if (!empty($getid3_temp->info['mpeg'])) {
                                

    public function analyze($filename$filesize=null, $original_filename='', $fp=null) {
        try {
            if (!$this->openfile($filename$filesize$fp)) {
                return $this->info;
            }

            // Handle tags             foreach (array('id3v2'=>'id3v2', 'id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {
                $option_tag = 'option_tag_'.$tag_name;
                if ($this->$option_tag) {
                    $this->include_module('tag.'.$tag_name);
                    try {
                        $tag_class = 'getid3_'.$tag_name;
                        $tag = new $tag_class($this);
                        
Home | Imprint | This part of the site doesn't use cookies.