$thisfile_riff_raw['fact'
]['NumberOfSamples'
] =
$this->
EitherEndian2Int(substr($thisfile_riff_WAVE['fact'
][0
]['data'
], 0, 4
));
// This should be a good way of calculating exact playtime,
// but some sample files have had incorrect number of samples,
// so cannot use this method
// if (!empty($thisfile_riff_raw['fmt ']['nSamplesPerSec'])) {
// $info['playtime_seconds'] = (float) $thisfile_riff_raw['fact']['NumberOfSamples'] / $thisfile_riff_raw['fmt ']['nSamplesPerSec'];
// }
} if (!
empty($thisfile_riff_raw['fmt '
]['nAvgBytesPerSec'
])) { $thisfile_audio['bitrate'
] = getid3_lib::
CastAsInt($thisfile_riff_raw['fmt '
]['nAvgBytesPerSec'
] * 8
);
} if (isset($thisfile_riff_WAVE['bext'
][0
]['data'
])) { // shortcut
$thisfile_riff_WAVE_bext_0 = &
$thisfile_riff_WAVE['bext'
][0
];
$thisfile_riff_WAVE_bext_0['title'
] =
substr($thisfile_riff_WAVE_bext_0['data'
], 0, 256
);
$thisfile_riff_WAVE_bext_0['author'
] =
substr($thisfile_riff_WAVE_bext_0['data'
], 256, 32
);
$thisfile_riff_WAVE_bext_0['reference'
] =
substr($thisfile_riff_WAVE_bext_0['data'
], 288, 32
);
foreach (array
('title','author','reference'
) as $bext_key) { // Some software (notably Logic Pro) may not blank existing data before writing a null-terminated string to the offsets