IP : 3.142.201.19Hostname : server86.web-hosting.comKernel : Linux server86.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64Disable Function : None :) OS : Linux
PATH:
/
home/
servlmvm/
public_html/
ad917/
./
../
wp-includes/
./
ID3/
module.audio.dts.php/
/
<?php
///////////////////////////////////////////////////////////////// /// getID3() by James Heinrich <info@getid3.org> // // available at https://github.com/JamesHeinrich/getID3 // // or https://www.getid3.org // // or http://getid3.sourceforge.net // // see readme.txt for more details // ///////////////////////////////////////////////////////////////// // // // module.audio.dts.php // // module for analyzing DTS Audio files // // dependencies: NONE // // // /////////////////////////////////////////////////////////////////
if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers exit; }
/** * @tutorial http://wiki.multimedia.cx/index.php?title=DTS */ class getid3_dts extends getid3_handler { /** * Default DTS syncword used in native .cpt or .dts formats. */ const syncword = "\x7F\xFE\x80\x01";
/** * @var int */ private $readBinDataOffset = 0;
/** * Possible syncwords indicating bitstream encoding. */ public static $syncwords = array( 0 => "\x7F\xFE\x80\x01", // raw big-endian 1 => "\xFE\x7F\x01\x80", // raw little-endian 2 => "\x1F\xFF\xE8\x00", // 14-bit big-endian 3 => "\xFF\x1F\x00\xE8"); // 14-bit little-endian
/** * @return bool */ public function Analyze() { $info = &$this->getid3->info; $info['fileformat'] = 'dts';
$this->fseek($info['avdataoffset']); $DTSheader = $this->fread(20); // we only need 2 words magic + 6 words frame header, but these words may be normal 16-bit words OR 14-bit words with 2 highest bits set to zero, so 8 words can be either 8*16/8 = 16 bytes OR 8*16*(16/14)/8 = 18.3 bytes
$info['audio']['dataformat'] = 'dts'; $info['audio']['lossless'] = $info['dts']['flags']['lossless']; $info['audio']['bitrate_mode'] = $info['dts']['bitrate_mode']; $info['audio']['bits_per_sample'] = $info['dts']['bits_per_sample']; $info['audio']['sample_rate'] = $info['dts']['sample_rate']; $info['audio']['channels'] = $info['dts']['channels']; $info['audio']['bitrate'] = $info['dts']['bitrate']; if (isset($info['avdataend']) && !empty($info['dts']['bitrate']) && is_numeric($info['dts']['bitrate'])) { $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) / ($info['dts']['bitrate'] / 8); if (($encoding == 2) || ($encoding == 3)) { // 14-bit data packed into 16-bit words, so the playtime is wrong because only (14/16) of the bytes in the data portion of the file are used at the specified bitrate $info['playtime_seconds'] *= (14 / 16); } } return true; }
/** * @param string $bin * @param int $length * * @return int */ private function readBinData($bin, $length) { $data = substr($bin, $this->readBinDataOffset, $length); $this->readBinDataOffset += $length;
/** * @param int $index * * @return int|false */ public static function numChannelsLookup($index) { switch ($index) { case 0: return 1; case 1: case 2: case 3: case 4: return 2; case 5: case 6: return 3; case 7: case 8: return 4; case 9: return 5; case 10: case 11: case 12: return 6; case 13: return 7; case 14: case 15: return 8; } return false; }
/** * @param int $index * * @return string */ public static function channelArrangementLookup($index) { static $lookup = array( 0 => 'A', 1 => 'A + B (dual mono)', 2 => 'L + R (stereo)', 3 => '(L+R) + (L-R) (sum-difference)', 4 => 'LT + RT (left and right total)', 5 => 'C + L + R', 6 => 'L + R + S', 7 => 'C + L + R + S', 8 => 'L + R + SL + SR', 9 => 'C + L + R + SL + SR', 10 => 'CL + CR + L + R + SL + SR', 11 => 'C + L + R+ LR + RR + OV', 12 => 'CF + CR + LF + RF + LR + RR', 13 => 'CL + C + CR + L + R + SL + SR', 14 => 'CL + CR + L + R + SL1 + SL2 + SR1 + SR2', 15 => 'CL + C+ CR + L + R + SL + S + SR', ); return (isset($lookup[$index]) ? $lookup[$index] : 'user-defined'); }
/** * @param int $index * @param int $version * * @return int|false */ public static function dialogNormalization($index, $version) { switch ($version) { case 7: return 0 - $index; case 6: return 0 - 16 - $index; } return false; }