<?php
+
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
-// available at http://getid3.sourceforge.net //
-// or http://www.getid3.org //
-// also https://github.com/JamesHeinrich/getID3 //
-/////////////////////////////////////////////////////////////////
-// See readme.txt for more details //
+// 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 //
class getid3_dts extends getid3_handler
{
/**
- * Default DTS syncword used in native .cpt or .dts formats
- */
- const syncword = "\x7F\xFE\x80\x01";
+ * 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
+ /**
+ * 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';
return true;
}
+ /**
+ * @param string $bin
+ * @param int $length
+ *
+ * @return float|int
+ */
private function readBinData($bin, $length) {
$data = substr($bin, $this->readBinDataOffset, $length);
$this->readBinDataOffset += $length;
return bindec($data);
}
+ /**
+ * @param int $index
+ *
+ * @return int|string|false
+ */
public static function bitrateLookup($index) {
static $lookup = array(
0 => 32000,
return (isset($lookup[$index]) ? $lookup[$index] : false);
}
+ /**
+ * @param int $index
+ *
+ * @return int|string|false
+ */
public static function sampleRateLookup($index) {
static $lookup = array(
0 => 'invalid',
return (isset($lookup[$index]) ? $lookup[$index] : false);
}
+ /**
+ * @param int $index
+ *
+ * @return int|false
+ */
public static function bitPerSampleLookup($index) {
static $lookup = array(
0 => 16,
return (isset($lookup[$index]) ? $lookup[$index] : false);
}
+ /**
+ * @param int $index
+ *
+ * @return int|false
+ */
public static function numChannelsLookup($index) {
switch ($index) {
case 0:
return false;
}
+ /**
+ * @param int $index
+ *
+ * @return string
+ */
public static function channelArrangementLookup($index) {
static $lookup = array(
0 => 'A',
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: