OggPageSegmentLength example

$commentdataoffset = 0;
        $VorbisCommentPage = 1;
        $CommentStartOffset = 0;

        switch ($info['audio']['dataformat']) {
            case 'vorbis':
            case 'speex':
            case 'opus':
                $CommentStartOffset = $info['ogg']['pageheader'][$VorbisCommentPage]['page_start_offset'];  // Second Ogg page, after header block                 $this->fseek($CommentStartOffset);
                $commentdataoffset = 27 + $info['ogg']['pageheader'][$VorbisCommentPage]['page_segments'];
                $commentdata = $this->fread(self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1) + $commentdataoffset);

                if ($info['audio']['dataformat'] == 'vorbis') {
                    $commentdataoffset += (strlen('vorbis') + 1);
                }
                else if ($info['audio']['dataformat'] == 'opus') {
                    $commentdataoffset += strlen('OpusTags');
                }

                break;

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