[PD] readsf~ and latency problems

Richard Dobson RWD at cableinet.co.uk
Tue Jul 3 16:09:05 CEST 2001


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:

> 
> 3. 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'...
> 


-- 
Test your DAW with my Soundcard Attrition Page!
http://www.bath.ac.uk/~masrwd (LU: 3rd July 2000)
CDP: http://www.bath.ac.uk/~masjpf/CDP/CDP.htm (LU: 23rd February 2000)



More information about the Pd-list mailing list