22 $info = &$this->getid3->info;
24 $info[
'fileformat'] =
'tta';
25 $info[
'audio'][
'dataformat'] =
'tta';
26 $info[
'audio'][
'lossless'] =
true;
27 $info[
'audio'][
'bitrate_mode'] =
'vbr';
30 $ttaheader = $this->
fread(26);
32 $info[
'tta'][
'magic'] = substr($ttaheader, 0, 3);
34 if (
$info[
'tta'][
'magic'] != $magic) {
36 unset(
$info[
'fileformat']);
37 unset(
$info[
'audio']);
42 switch ($ttaheader{3}) {
47 $info[
'tta'][
'major_version'] = 1;
48 $info[
'avdataoffset'] += 16;
50 $info[
'tta'][
'compression_level'] = ord($ttaheader{3});
56 $info[
'audio'][
'encoder_options'] =
'-e'.$info[
'tta'][
'compression_level'];
57 $info[
'playtime_seconds'] = $info[
'tta'][
'samples_per_channel'] / $info[
'tta'][
'sample_rate'];
62 $info[
'tta'][
'major_version'] = 2;
63 $info[
'avdataoffset'] += 20;
72 $info[
'audio'][
'encoder_options'] =
'-e'.$info[
'tta'][
'compression_level'];
73 $info[
'playtime_seconds'] = $info[
'tta'][
'data_length'] / $info[
'tta'][
'sample_rate'];
78 $info[
'tta'][
'major_version'] = 3;
79 $info[
'avdataoffset'] += 26;
86 $info[
'tta'][
'crc32_footer'] = substr($ttaheader, 18, 4);
89 $info[
'playtime_seconds'] = $info[
'tta'][
'data_length'] / $info[
'tta'][
'sample_rate'];
93 $this->
error(
'This version of getID3() ['.$this->getid3->version().
'] only knows how to handle TTA v1 and v2 - it may not work correctly with this file which appears to be TTA v'.$ttaheader{3});
98 $info[
'audio'][
'encoder'] =
'TTA v'.$info[
'tta'][
'major_version'];
99 $info[
'audio'][
'bits_per_sample'] =
$info[
'tta'][
'bits_per_sample'];
100 $info[
'audio'][
'sample_rate'] =
$info[
'tta'][
'sample_rate'];
101 $info[
'audio'][
'channels'] =
$info[
'tta'][
'channels'];
102 $info[
'audio'][
'bitrate'] = ((
$info[
'avdataend'] -
$info[
'avdataoffset']) * 8) /
$info[
'playtime_seconds'];
getID3() by James Heinrich info@getid3.org //
static LittleEndian2Int($byteword, $signed=false)
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
fseek($bytes, $whence=SEEK_SET)