wppaste
WordPress

getid3_ogg

Source
wp-includes/ID3/module.audio.ogg.php:22

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Methods · 10

Source code

class getid3_ogg extends getid3_handler{	/**	 * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html	 *	 * @return bool	 */	public function Analyze() {		$info = &$this->getid3->info; 		$info['fileformat'] = 'ogg'; 		// Warn about illegal tags - only vorbiscomments are allowed		if (isset($info['id3v2'])) {			$this->warning('Illegal ID3v2 tag present.');		}		if (isset($info['id3v1'])) {			$this->warning('Illegal ID3v1 tag present.');		}		if (isset($info['ape'])) {			$this->warning('Illegal APE tag present.');		}  		// Page 1 - Stream Header 		$this->fseek($info['avdataoffset']); 		$oggpageinfo = $this->ParseOggPageHeader();		$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; 		if ($this->ftell() >= $this->getid3->fread_buffer_size()) {			$this->error('Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)');			unset($info['fileformat']);			unset($info['ogg']);			return false;		} 		$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 			$info['audio']['dataformat']   = 'speex';			$info['mime_type']             = 'audio/speex';			$info['audio']['bitrate_mode'] = 'abr';			$info['audio']['lossless']     = false; 			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_string']           =                              substr($filedata, $filedataoffset, 8); // hard-coded to 'Speex   '			$filedataoffset += 8;			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']          =                              substr($filedata, $filedataoffset, 20);			$filedataoffset += 20;			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version_id']       = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));			$filedataoffset += 4;			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['header_size']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));			$filedataoffset += 4;			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));			$filedataoffset += 4;			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));			$filedataoffset += 4;			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode_bitstream_version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));			$filedataoffset += 4;

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/ID3/module.audio.ogg.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.