22 $info = &$this->getid3->info;
25 $DSSheader = $this->
fread(1540);
27 if (!preg_match(
'#^(\x02|\x03)ds[s2]#', $DSSheader)) {
28 $info[
'error'][] =
'Expecting "[02-03] 64 73 [73|32]" at offset '.$info[
'avdataoffset'].
', found "'.
getid3_lib::PrintHexBytes(substr($DSSheader, 0, 4)).
'"';
33 $info[
'encoding'] =
'ISO-8859-1';
34 $info[
'dss'] = array();
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));
49 $info[
'dss'][
'priority'] = ord(substr($DSSheader, 793, 1));
50 $info[
'dss'][
'comments'] = trim(substr($DSSheader, 798, 100));
51 $info[
'dss'][
'sample_rate_index'] = ord(substr($DSSheader, 1538, 1));
53 $info[
'audio'][
'bits_per_sample'] = 16;
55 $info[
'audio'][
'channels'] = 1;
57 $info[
'playtime_seconds'] =
$info[
'dss'][
'playtime_ms'] / 1000;
58 if (floor(
$info[
'dss'][
'playtime_ms'] / 1000) !=
$info[
'dss'][
'playtime_sec']) {
60 $info[
'playtime_seconds'] =
$info[
'dss'][
'playtime_sec'];
61 $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');
63 $info[
'audio'][
'bitrate'] = (
$info[
'filesize'] * 8) /
$info[
'playtime_seconds'];
69 $y = substr($datestring, 0, 2);
70 $m = substr($datestring, 2, 2);
71 $d = substr($datestring, 4, 2);
72 $h = substr($datestring, 6, 2);
73 $i = substr($datestring, 8, 2);
74 $s = substr($datestring, 10, 2);
75 $y += ((
$y < 95) ? 2000 : 1900);
76 return mktime(
$h, $i, $s, $m,
$d,
$y);
80 static $dssSampleRateLookup = array(
86 if (!array_key_exists($sample_rate_index, $dssSampleRateLookup)) {
87 $this->getid3->warning(
'unknown sample_rate_index: '.$sample_rate_index);
90 return $dssSampleRateLookup[$sample_rate_index];
LittleEndian2Int($byteword, $signed=false)
getID3() by James Heinrich info@getid3.org //
DSSdateStringToUnixDate($datestring)
fseek($bytes, $whence=SEEK_SET)
PrintHexBytes($string, $hex=true, $spaces=true, $htmlsafe=true)
DSSsampleRateLookup($sample_rate_index)