: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'IDIT'=>'digitizationdate',
'IFRM'=>'accountofparts',
'IPDS'=>'productiondesigner',
'ISGN'=>'secondarygenre',
'ISRC'=>'sourcesupplier',
'ISRF'=>'digitizationsource',
'ISTD'=>'productionstudio',
foreach ($RIFFinfoKeyLookup as $key => $value) {
if (isset($RIFFinfoArray[$key])) {
foreach ($RIFFinfoArray[$key] as $commentid => $commentdata) {
if (!empty($commentdata['data']) && trim($commentdata['data']) != '') {
if (isset($CommentsTargetArray[$value])) {
$CommentsTargetArray[$value][] = trim($commentdata['data']);
$CommentsTargetArray[$value] = array(trim($commentdata['data']));
* @param string $WaveFormatExData
public static function parseWAVEFORMATex($WaveFormatExData) {
$WaveFormatEx['raw'] = array();
$WaveFormatEx_raw = &$WaveFormatEx['raw'];
$WaveFormatEx_raw['wFormatTag'] = substr($WaveFormatExData, 0, 2);
$WaveFormatEx_raw['nChannels'] = substr($WaveFormatExData, 2, 2);
$WaveFormatEx_raw['nSamplesPerSec'] = substr($WaveFormatExData, 4, 4);
$WaveFormatEx_raw['nAvgBytesPerSec'] = substr($WaveFormatExData, 8, 4);
$WaveFormatEx_raw['nBlockAlign'] = substr($WaveFormatExData, 12, 2);
$WaveFormatEx_raw['wBitsPerSample'] = substr($WaveFormatExData, 14, 2);
if (strlen($WaveFormatExData) > 16) {
$WaveFormatEx_raw['cbSize'] = substr($WaveFormatExData, 16, 2);
$WaveFormatEx_raw = array_map('getid3_lib::LittleEndian2Int', $WaveFormatEx_raw);
$WaveFormatEx['codec'] = self::wFormatTagLookup($WaveFormatEx_raw['wFormatTag']);
$WaveFormatEx['channels'] = $WaveFormatEx_raw['nChannels'];
$WaveFormatEx['sample_rate'] = $WaveFormatEx_raw['nSamplesPerSec'];
$WaveFormatEx['bitrate'] = $WaveFormatEx_raw['nAvgBytesPerSec'] * 8;
$WaveFormatEx['bits_per_sample'] = $WaveFormatEx_raw['wBitsPerSample'];
* @param string $WavPackChunkData
public function parseWavPackHeader($WavPackChunkData) {
// short bits; // added for version 2.00
// short flags, shift; // added for version 3.00
// long total_samples, crc, crc2;
// char extension [4], extra_bc, extras [3];
$info = &$this->getid3->info;
$info['wavpack'] = array();
$thisfile_wavpack = &$info['wavpack'];
$thisfile_wavpack['version'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 0, 2));
if ($thisfile_wavpack['version'] >= 2) {
$thisfile_wavpack['bits'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 2, 2));
if ($thisfile_wavpack['version'] >= 3) {
$thisfile_wavpack['flags_raw'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 4, 2));
$thisfile_wavpack['shift'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 6, 2));
$thisfile_wavpack['total_samples'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 8, 4));
$thisfile_wavpack['crc1'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 12, 4));
$thisfile_wavpack['crc2'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 16, 4));
$thisfile_wavpack['extension'] = substr($WavPackChunkData, 20, 4);
$thisfile_wavpack['extra_bc'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 24, 1));
for ($i = 0; $i <= 2; $i++) {
$thisfile_wavpack['extras'][] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 25 + $i, 1));
$thisfile_wavpack['flags'] = array();
$thisfile_wavpack_flags = &$thisfile_wavpack['flags'];
$thisfile_wavpack_flags['mono'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000001);
$thisfile_wavpack_flags['fast_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000002);
$thisfile_wavpack_flags['raw_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000004);
$thisfile_wavpack_flags['calc_noise'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000008);
$thisfile_wavpack_flags['high_quality'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000010);
$thisfile_wavpack_flags['3_byte_samples'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000020);
$thisfile_wavpack_flags['over_20_bits'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000040);
$thisfile_wavpack_flags['use_wvc'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000080);
$thisfile_wavpack_flags['noiseshaping'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000100);
$thisfile_wavpack_flags['very_fast_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000200);
$thisfile_wavpack_flags['new_high_quality'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000400);
$thisfile_wavpack_flags['cancel_extreme'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000800);
$thisfile_wavpack_flags['cross_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x001000);
$thisfile_wavpack_flags['new_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x002000);
$thisfile_wavpack_flags['joint_stereo'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x004000);
$thisfile_wavpack_flags['extra_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x008000);
$thisfile_wavpack_flags['override_noiseshape'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x010000);
$thisfile_wavpack_flags['override_jointstereo'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x020000);
$thisfile_wavpack_flags['copy_source_filetime'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x040000);
$thisfile_wavpack_flags['create_exe'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x080000);
* @param string $BITMAPINFOHEADER
* @param bool $littleEndian
public static function ParseBITMAPINFOHEADER($BITMAPINFOHEADER, $littleEndian=true) {
$parsed['biSize'] = substr($BITMAPINFOHEADER, 0, 4); // number of bytes required by the BITMAPINFOHEADER structure
$parsed['biWidth'] = substr($BITMAPINFOHEADER, 4, 4); // width of the bitmap in pixels
$parsed['biHeight'] = substr($BITMAPINFOHEADER, 8, 4); // height of the bitmap in pixels. If biHeight is positive, the bitmap is a 'bottom-up' DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a 'top-down' DIB and its origin is the upper left corner
$parsed['biPlanes'] = substr($BITMAPINFOHEADER, 12, 2); // number of color planes on the target device. In most cases this value must be set to 1
$parsed['biBitCount'] = substr($BITMAPINFOHEADER, 14, 2); // Specifies the number of bits per pixels
$parsed['biSizeImage'] = substr($BITMAPINFOHEADER, 20, 4); // size of the bitmap data section of the image (the actual pixel data, excluding BITMAPINFOHEADER and RGBQUAD structures)
$parsed['biXPelsPerMeter'] = substr($BITMAPINFOHEADER, 24, 4); // horizontal resolution, in pixels per metre, of the target device
$parsed['biYPelsPerMeter'] = substr($BITMAPINFOHEADER, 28, 4); // vertical resolution, in pixels per metre, of the target device
$parsed['biClrUsed'] = substr($BITMAPINFOHEADER, 32, 4); // actual number of color indices in the color table used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression
$parsed['biClrImportant'] = substr($BITMAPINFOHEADER, 36, 4); // number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important
$parsed = array_map('getid3_lib::'.($littleEndian ? 'Little' : 'Big').'Endian2Int', $parsed);
$parsed['fourcc'] = substr($BITMAPINFOHEADER, 16, 4); // compression identifier
public static function ParseDIVXTAG($DIVXTAG, $raw=false) {
// structure from "IDivX" source, Form1.frm, by "Greg Frazier of Daemonic Software Group", email: gfrazier@icestorm.net, web: http://dsg.cjb.net/
// source available at http://files.divx-digest.com/download/c663efe7ef8ad2e90bf4af4d3ea6188a/on0SWN2r/edit/IDivX.zip
// 'Byte Layout: '1111111111111111
// '32 for Movie - 1 '1111111111111111
// '28 for Author - 6 '6666666666666666
// '4 for year - 2 '6666666666662222
// '3 for genre - 3 '7777777777777777
// '48 for Comments - 7 '7777777777777777
// '1 for Rating - 4 '7777777777777777
// '5 for Future Additions - 0 '333400000DIVXTAG
static $DIVXTAGgenre = array(
$parsed['title'] = trim(substr($DIVXTAG, 0, 32));
$parsed['artist'] = trim(substr($DIVXTAG, 32, 28));
$parsed['year'] = intval(trim(substr($DIVXTAG, 60, 4)));
$parsed['comment'] = trim(substr($DIVXTAG, 64, 48));
$parsed['genre_id'] = intval(trim(substr($DIVXTAG, 112, 3)));
$parsed['rating_id'] = ord(substr($DIVXTAG, 115, 1));
//$parsed['padding'] = substr($DIVXTAG, 116, 5); // 5-byte null
//$parsed['magic'] = substr($DIVXTAG, 121, 7); // "DIVXTAG"
$parsed['genre'] = (isset($DIVXTAGgenre[$parsed['genre_id']]) ? $DIVXTAGgenre[$parsed['genre_id']] : $parsed['genre_id']);
$parsed['rating'] = (isset($DIVXTAGrating[$parsed['rating_id']]) ? $DIVXTAGrating[$parsed['rating_id']] : $parsed['rating_id']);
unset($parsed['genre_id'], $parsed['rating_id']);
foreach ($parsed as $key => $value) {
foreach ($parsed as $tag => $value) {
$parsed[$tag] = array($value);
* @param string $tagshortname
public static function waveSNDMtagLookup($tagshortname) {
/** This is not a comment!
return getid3_lib::EmbeddedLookup($tagshortname, $begin, __LINE__, __FILE__, 'riff-sndm');
public static function wFormatTagLookup($wFormatTag) {
/** This is not a comment!
0x0000 Microsoft Unknown Wave Format
0x0001 Pulse Code Modulation (PCM)
0x0004 Compaq Computer VSELP
0x0011 Intel DVI/IMA ADPCM
0x0012 Videologic MediaSpace ADPCM
0x0013 Sierra Semiconductor ADPCM
0x0014 Antex Electronics G.723 ADPCM
0x0015 DSP Solutions DigiSTD
0x0016 DSP Solutions DigiFIX
0x0017 Dialogic OKI ADPCM
0x0019 Hewlett-Packard CU
0x0021 Speech Compression Sonarc
0x0022 DSP Group TrueSpeech
0x0023 Echo Speech EchoSC1
0x0025 Audio Processing Technology APTX
0x0031 Microsoft GSM 6.10
0x0033 Antex Electronics ADPCME
0x0034 Control Resources VQLPC
0x0035 DSP Solutions DigiREAL
0x0036 DSP Solutions DigiADPCM
0x0037 Control Resources CR10
0x0038 Natural MicroSystems VBXADPCM
0x0039 Crystal Semiconductor IMA ADPCM
0x0040 Antex Electronics G.721 ADPCM
0x0050 MPEG Layer-2 or Layer-1
0x0069 Voxware Byte Aligned
0x0094 Aculab PLC Prosody 8kbps
0x0103 IBM AVC Adaptive Differential Pulse Code Modulation (ADPCM)
0x0130 Sipro Lab Telecom ACELP NET
0x0131 Sipro Lab Telecom ACELP 4800
0x0132 Sipro Lab Telecom ACELP 8V3
0x0133 Sipro Lab Telecom G.729
0x0134 Sipro Lab Telecom G.729A
0x0135 Sipro Lab Telecom Kelvin
0x0140 Windows Media Video V8
0x0150 Qualcomm PureVoice
0x0155 Ring Zero Systems TUB GSM
0x0161 Windows Media Audio V7 / V8 / V9
0x0162 Windows Media Audio Professional V9
0x0163 Windows Media Audio Lossless V9
0x0200 Creative Labs ADPCM
0x0202 Creative Labs Fastspeech8
0x0203 Creative Labs Fastspeech10
0x0210 UHER Informatic GmbH ADPCM
0x0230 I-link Worldwide VC
0x0250 Interactive Products HSX
0x0251 Interactive Products RPELP
0x0260 Consistent Software CS2
0x0300 Fujitsu FM Towns Snd
0x08AE ClearJump LiteWave
0x1100 Lernout & Hauspie Codec (0x1100)
0x1101 Lernout & Hauspie CELP Codec (0x1101)
0x1102 Lernout & Hauspie SBC Codec (0x1102)
0x1103 Lernout & Hauspie SBC Codec (0x1103)
0x1104 Lernout & Hauspie SBC Codec (0x1104)
0x1500 Soundspace Music Compression
0x181C VoxWare RT24 Speech
0x1FC4 NCT Soft ALF2CD (www.nctsoft.com)
0x7A21 GSM-AMR (CBR, no SID)
0x7A22 GSM-AMR (VBR, including SID)
0xFFFE WAVE_FORMAT_EXTENSIBLE
0xFFFF WAVE_FORMAT_DEVELOPMENT
return getid3_lib::EmbeddedLookup('0x'.str_pad(strtoupper(dechex($wFormatTag)), 4, '0', STR_PAD_LEFT), $begin, __LINE__, __FILE__, 'riff-wFormatTag');
public static function fourccLookup($fourcc) {
/** This is not a comment!
swot http://developer.apple.com/qa/snd/snd07.html
_BIT BI_BITFIELDS (Raw RGB)
_PNG PNG compressed W3C/ISO/IEC (RFC-2083)
_RAW Full Frames (Uncompressed)
AEMI Array Microsystems VideoONE MPEG1-I Capture
AFLC Autodesk Animator FLC
AFLI Autodesk Animator FLI
AMPG Array Microsystems VideoONE MPEG
AP41 AngelPotion Definitive
ASVX Asus Video 2.0 (audio)
AUR2 AuraVision Aura 2 Codec - YUV 4:2:2
AURA AuraVision Aura 1 Codec - YUV 4:1:1
AVDJ Independent JPEG Group\'s codec (AVDJ)
AVRN Independent JPEG Group\'s codec (AVRN)
AZPR Quicktime Apple Video (AZPR)
BLZ0 Blizzard DivX MPEG-4
BTVC Conexant Composite Video
BINK RAD Game Tools Bink Video
BT20 Conexant Prosumer Video