ParseVorbisComments example

// Page 2 - Comment Header         $oggpageinfo = $this->ParseOggPageHeader();
        $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;

        switch ($info['audio']['dataformat']) {
            case 'vorbis':
                $filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
                $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, 0, 1));
                $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] =                              substr($filedata, 1, 6); // hard-coded to 'vorbis'
                $this->ParseVorbisComments();
                break;

            case 'flac':
                $flac = new getid3_flac($this->getid3);
                if (!$flac->parseMETAdata()) {
                    $this->error('Failed to parse FLAC headers');
                    return false;
                }
                unset($flac);
                break;

            

    private function parseVORBIS_COMMENT($BlockData) {
        $info = &$this->getid3->info;

        $getid3_ogg = new getid3_ogg($this->getid3);
        if ($this->isDependencyFor('matroska')) {
            $getid3_ogg->setStringMode($this->data_string);
        }
        $getid3_ogg->ParseVorbisComments();
        if (isset($info['ogg'])) {
            unset($info['ogg']['comments_raw']);
            $info['flac']['VORBIS_COMMENT'] = $info['ogg'];
            unset($info['ogg']);
        }

        unset($getid3_ogg);

        return true;
    }

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