Hi,
I encounter a strange problem reading the headers of wav files created by protools. All other wav files work fine. I use the code below to extract header information according to the cannonical wave file format. This also works fine with the protools wavs but only up to the 'SubChunk1ID'. THis results in "bext" in the protools file, meaning it's a Broadcast Wave Format (which should not cause any problems). The next value SubChunk1Size returns "602" in protools file - the usual SubChunk1Size for regular wav files (which have SubChinkID = "fmt ") is "16". Now even if I point my reader after these "602" I cannot extract any useful information. Going through the specs did not help either... Many thanks for any hints. Jan
$fp = fopen($target_path, 'r');
$binstr = file_get_contents($target_path);
$wavs = array();
$wavs['ChunkID'] = substr($binstr,0,4);
$wavs['ChunkSize'] = unpackHeader(substr($binstr,4,4));
$wavs['Format'] = substr($binstr,8,4);
$wavs['Subchunk1ID'] = substr($binstr,12,4);
$wavs['SubChunk1Size'] = unpackHeader(substr($binstr,16,4));
$wavs['AudioFormat'] = unpackHeader(substr($binstr,20,2));
$wavs['NumChannels'] = unpackHeader(substr($binstr,22,2));
$wavs['SampleRate'] = unpackHeader(substr($binstr,24,4));
$wavs['ByteRate'] = unpackHeader(substr($binstr,28,4));
$wavs['BlockAlign'] = unpackHeader(substr($binstr,32,2));
$wavs['BitsPerSample'] = unpackHeader(substr($binstr,34,2));