You are basically saying that the WAVE parsing is wrong (as it so often is in unix apps!). It takes about three extra lines of simple code to jump over unknown chunks, and then ~all~ WAVE files (e.g those produced by Csound including the PEAK chunk - which PD could find very useful anyway!) can be read by PD. The WAVE spec requires that the data chunk is after the fmt chunk, so this simple skipping of unknown chunks will always work. In fact, there can be other chunks ~before~ the fmt chunk; it should not be presumed to be immediately after the RIFF<>WAVE<> elements.
I have some example files with the PEAK chunk on my "Soundcard Attrition Page", if anyone wants to experiment. There are also some examples with a 'long' header as used in CDP.
Richard Dobson
Krzysztof Czaja wrote:
- The readsf~ (and soundfiler) objects assume there is a 'data' chunk
right after a 'fmt' chunk in a .wav file. If your sound was saved in wavelab or some such windowish app, there could be another chunk in between, like a 'PAD' chunk. If so, then readsf~ reads only from this extra chunk (which is usually all zeros) -- and you 'really have to work out how big your header is'...