21 $info = &$this->getid3->info;
26 $info[
'fileformat'] =
'vqf';
27 $info[
'audio'][
'dataformat'] =
'vqf';
28 $info[
'audio'][
'bitrate_mode'] =
'cbr';
29 $info[
'audio'][
'lossless'] =
false;
33 $thisfile_vqf = &
$info[
'vqf'];
34 $thisfile_vqf_raw = &$thisfile_vqf[
'raw'];
37 $VQFheaderData = $this->
fread(16);
40 $thisfile_vqf_raw[
'header_tag'] = substr($VQFheaderData, $offset, 4);
42 if ($thisfile_vqf_raw[
'header_tag'] != $magic) {
45 unset(
$info[
'fileformat']);
49 $thisfile_vqf_raw[
'version'] = substr($VQFheaderData, $offset, 8);
56 $ChunkBaseOffset = $this->
ftell();
58 $ChunkData = $this->
fread(8);
59 $ChunkName = substr($ChunkData, $chunkoffset, 4);
60 if ($ChunkName ==
'DATA') {
61 $info[
'avdataoffset'] = $ChunkBaseOffset;
67 if ($ChunkSize > (
$info[
'avdataend'] - $this->
ftell())) {
68 $this->
error(
'Invalid chunk size ('.$ChunkSize.
') for chunk "'.$ChunkName.
'" at offset '.$ChunkBaseOffset);
72 $ChunkData .= $this->
fread($ChunkSize);
78 $thisfile_vqf[
'COMM'] =
array();
79 $thisfile_vqf_COMM = &$thisfile_vqf[
'COMM'];
90 $info[
'audio'][
'channels'] = $thisfile_vqf_COMM[
'channel_mode'] + 1;
92 $info[
'audio'][
'bitrate'] = $thisfile_vqf_COMM[
'bitrate'] * 1000;
93 $info[
'audio'][
'encoder_options'] =
'CBR' . ceil(
$info[
'audio'][
'bitrate']/1000);
95 if (
$info[
'audio'][
'bitrate'] == 0) {
96 $this->
error(
'Corrupt VQF file: bitrate_audio == zero');
115 $this->
warning(
'Unhandled chunk type "'.$ChunkName.
'" at offset '.$ChunkBaseOffset);
120 $info[
'playtime_seconds'] = ((
$info[
'avdataend'] -
$info[
'avdataoffset']) * 8) /
$info[
'audio'][
'bitrate'];
122 if (isset($thisfile_vqf[
'DSIZ']) && (($thisfile_vqf[
'DSIZ'] != (
$info[
'avdataend'] -
$info[
'avdataoffset'] - strlen(
'DATA'))))) {
123 switch ($thisfile_vqf[
'DSIZ']) {
126 $this->
warning(
'Invalid DSIZ value "'.$thisfile_vqf[
'DSIZ'].
'". This is known to happen with VQF files encoded by Ahead Nero, and seems to be its way of saying this is TwinVQF v'.($thisfile_vqf[
'DSIZ'] + 1).
'.0');
127 $info[
'audio'][
'encoder'] =
'Ahead Nero';
131 $this->
warning(
'Probable corrupted file - should be '.$thisfile_vqf[
'DSIZ'].
' bytes, actually '.(
$info[
'avdataend'] -
$info[
'avdataoffset'] - strlen(
'DATA')));
140 static $VQFchannelFrequencyLookup =
array(
145 return (isset($VQFchannelFrequencyLookup[$frequencyid]) ? $VQFchannelFrequencyLookup[$frequencyid] : $frequencyid * 1000);
149 static $VQFcommentNiceNameLookup =
array(
152 '(c) ' =>
'copyright',
153 'FILE' =>
'filename',
157 return (isset($VQFcommentNiceNameLookup[$shortname]) ? $VQFcommentNiceNameLookup[$shortname] : $shortname);
VQFcommentNiceNameLookup($shortname)
getID3() by James Heinrich info@getid3.org //
VQFchannelFrequencyLookup($frequencyid)
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
Create styles array
The data for the language used.
fseek($bytes, $whence=SEEK_SET)
static BigEndian2Int($byteword, $synchsafe=false, $signed=false)