getid3_mp3 example

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'])) {
                                $info['mpeg'] = $getid3_temp->info['mpeg'];
                                if (isset($info['mpeg']['audio'])) {
                                    $info['audio']['dataformat']   = 'mp3';
                                    
if (!empty($thisfile_audio['streams'])) {
                foreach ($thisfile_audio['streams'] as $streamnumber => $streamdata) {
                    if ($streamdata['dataformat'] == $thisfile_audio_dataformat) {
                        $thisfile_audio['streams'][$streamnumber]['sample_rate']  = $thisfile_audio['sample_rate'];
                        $thisfile_audio['streams'][$streamnumber]['channels']     = $thisfile_audio['channels'];
                        $thisfile_audio['streams'][$streamnumber]['bitrate']      = $thisfile_audio['bitrate'];
                        $thisfile_audio['streams'][$streamnumber]['bitrate_mode'] = $thisfile_audio['bitrate_mode'];
                        $thisfile_audio['streams'][$streamnumber]['codec']        = $thisfile_audio['codec'];
                    }
                }
            }
            $getid3_mp3 = new getid3_mp3($this->getid3);
            $thisfile_audio['encoder_options'] = $getid3_mp3->GuessEncoderOptions();
            unset($getid3_mp3);
        }


        if (!empty($thisfile_riff_raw['fmt ']['wBitsPerSample']) && ($thisfile_riff_raw['fmt ']['wBitsPerSample'] > 0)) {
            switch ($thisfile_audio_dataformat) {
                case 'ac3':
                    // ignore bits_per_sample                     break;

                
Home | Imprint | This part of the site doesn't use cookies.