22 $info = &$this->getid3->info;
25 $DSSheader = $this->
fread(1540);
27 if (!preg_match(
'#^[\\x02-\\x06]ds[s2]#', $DSSheader)) {
33 $info[
'encoding'] =
'ISO-8859-1';
36 $info[
'fileformat'] =
'dss';
37 $info[
'mime_type'] =
'audio/x-'.substr($DSSheader, 1, 3);
38 $info[
'audio'][
'dataformat'] = substr($DSSheader, 1, 3);
39 $info[
'audio'][
'bitrate_mode'] =
'cbr';
41 $info[
'dss'][
'version'] = ord(substr($DSSheader, 0, 1));
42 $info[
'dss'][
'hardware'] = trim(substr($DSSheader, 12, 16));
47 $info[
'dss'][
'playtime_sec'] = intval((substr($DSSheader, 62, 2) * 3600) + (substr($DSSheader, 64, 2) * 60) + substr($DSSheader, 66, 2));
48 if (
$info[
'dss'][
'version'] <= 3) {
50 $info[
'dss'][
'priority'] = ord(substr($DSSheader, 793, 1));
51 $info[
'dss'][
'comments'] = trim(substr($DSSheader, 798, 100));
52 $info[
'dss'][
'sample_rate_index'] = ord(substr($DSSheader, 1538, 1));
55 $this->getid3->warning(
'DSS above version 3 not fully supported in this version of getID3. Any additional documentation or format specifications would be welcome. This file is version '.
$info[
'dss'][
'version']);
58 $info[
'audio'][
'bits_per_sample'] = 16;
59 $info[
'audio'][
'channels'] = 1;
61 if (!empty(
$info[
'dss'][
'playtime_ms']) && (floor(
$info[
'dss'][
'playtime_ms'] / 1000) ==
$info[
'dss'][
'playtime_sec'])) {
62 $info[
'playtime_seconds'] =
$info[
'dss'][
'playtime_ms'] / 1000;
64 $info[
'playtime_seconds'] =
$info[
'dss'][
'playtime_sec'];
65 if (!empty(
$info[
'dss'][
'playtime_ms'])) {
66 $this->getid3->warning(
'playtime_ms ('.number_format(
$info[
'dss'][
'playtime_ms'] / 1000, 3).
') does not match playtime_sec ('.number_format(
$info[
'dss'][
'playtime_sec']).
') - using playtime_sec value');
69 $info[
'audio'][
'bitrate'] = (
$info[
'filesize'] * 8) /
$info[
'playtime_seconds'];
75 $y = substr($datestring, 0, 2);
76 $m = substr($datestring, 2, 2);
77 $d = substr($datestring, 4, 2);
78 $h = substr($datestring, 6, 2);
79 $i = substr($datestring, 8, 2);
80 $s = substr($datestring, 10, 2);
81 $y += ((
$y < 95) ? 2000 : 1900);
86 static $dssSampleRateLookup =
array(
92 if (!array_key_exists($sample_rate_index, $dssSampleRateLookup)) {
93 $this->getid3->warning(
'unknown sample_rate_index: 0x'.strtoupper(dechex($sample_rate_index)));
96 return $dssSampleRateLookup[$sample_rate_index];
static LittleEndian2Int($byteword, $signed=false)
getID3() by James Heinrich info@getid3.org //
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
Create styles array
The data for the language used.
DSSdateStringToUnixDate($datestring)
fseek($bytes, $whence=SEEK_SET)
DSSsampleRateLookup($sample_rate_index)
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d