WordPress at a glance
function is not described

getid3_ogg::ParseVorbisPageHeader() public WP 1.0

{} It's a method of the class: getid3_ogg{}

No Hooks.

Return

true|false.

Usage

$getid3_ogg = new getid3_ogg();
$getid3_ogg->ParseVorbisPageHeader( $filedata, $filedataoffset, $oggpageinfo );
$filedata(string) (required) (passed by reference — &)
-
$filedataoffset(int) (required) (passed by reference — &)
-
$oggpageinfo(array) (required) (passed by reference — &)
-

Code of getid3_ogg::ParseVorbisPageHeader() WP 5.7.2

<?php
public function ParseVorbisPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) {
	$info = &$this->getid3->info;
	$info['audio']['dataformat'] = 'vorbis';
	$info['audio']['lossless']   = false;

	$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));
	$filedataoffset += 1;
	$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, $filedataoffset, 6); // hard-coded to 'vorbis'
	$filedataoffset += 6;
	$info['ogg']['bitstreamversion'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
	$filedataoffset += 4;
	$info['ogg']['numberofchannels'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));
	$filedataoffset += 1;
	$info['audio']['channels']       = $info['ogg']['numberofchannels'];
	$info['ogg']['samplerate']       = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
	$filedataoffset += 4;
	if ($info['ogg']['samplerate'] == 0) {
		$this->error('Corrupt Ogg file: sample rate == zero');
		return false;
	}
	$info['audio']['sample_rate']    = $info['ogg']['samplerate'];
	$info['ogg']['samples']          = 0; // filled in later
	$info['ogg']['bitrate_average']  = 0; // filled in later
	$info['ogg']['bitrate_max']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
	$filedataoffset += 4;
	$info['ogg']['bitrate_nominal']  = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
	$filedataoffset += 4;
	$info['ogg']['bitrate_min']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
	$filedataoffset += 4;
	$info['ogg']['blocksize_small']  = pow(2,  getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0x0F);
	$info['ogg']['blocksize_large']  = pow(2, (getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0xF0) >> 4);
	$info['ogg']['stop_bit']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); // must be 1, marks end of packet

	$info['audio']['bitrate_mode'] = 'vbr'; // overridden if actually abr
	if ($info['ogg']['bitrate_max'] == 0xFFFFFFFF) {
		unset($info['ogg']['bitrate_max']);
		$info['audio']['bitrate_mode'] = 'abr';
	}
	if ($info['ogg']['bitrate_nominal'] == 0xFFFFFFFF) {
		unset($info['ogg']['bitrate_nominal']);
	}
	if ($info['ogg']['bitrate_min'] == 0xFFFFFFFF) {
		unset($info['ogg']['bitrate_min']);
		$info['audio']['bitrate_mode'] = 'abr';
	}
	return true;
}