ParseVorbisPageHeader example


                                $vorbis_offset -= 1;

                                getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true);

                                // create temp instance                                 $getid3_temp = new getID3();

                                // analyze                                 $getid3_ogg = new getid3_ogg($getid3_temp);
                                $oggpageinfo['page_seqno'] = 0;
                                $getid3_ogg->ParseVorbisPageHeader($trackarray['CodecPrivate']$vorbis_offset$oggpageinfo);
                                if (!empty($getid3_temp->info['ogg'])) {
                                    $info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $getid3_temp->info['ogg'];
                                    if (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {
                                        foreach ($getid3_temp->info['audio'] as $sub_key => $value) {
                                            $track_info[$sub_key] = $value;
                                        }
                                    }
                                }

                                // copy errors and warnings                                 if (!empty($getid3_temp->info['error'])) {
                                    
$filedata = $this->fread($oggpageinfo['page_length']);
        $filedataoffset = 0;

        if (substr($filedata, 0, 4) == 'fLaC') {

            $info['audio']['dataformat']   = 'flac';
            $info['audio']['bitrate_mode'] = 'vbr';
            $info['audio']['lossless']     = true;

        } elseif (substr($filedata, 1, 6) == 'vorbis') {

            $this->ParseVorbisPageHeader($filedata$filedataoffset$oggpageinfo);

        } elseif (substr($filedata, 0, 8) == 'OpusHead') {

            if ($this->ParseOpusPageHeader($filedata$filedataoffset$oggpageinfo) === false) {
                return false;
            }

        } elseif (substr($filedata, 0, 8) == 'Speex ') {

            // http://www.speex.org/manual/node10.html
            
Home | Imprint | This part of the site doesn't use cookies.