[PD] acquiring information about wav files

Roman Haefeli reduzierer at yahoo.de
Fri Jan 29 00:37:05 CET 2010


On Thu, 2010-01-28 at 22:59 +0000, Andrew Faraday wrote:
> I'm not sure about the number of channels, however there is a slightly
> round-about way to get the number of samples from a file. 
> 
> 
> Write to an array using [soundfiler] with the -resize flag. Then use
> [arraysize] to find the size of the array. Et voila, the number of
> samples in your file. 

Hehe, when using this approach, one could load a file into n arrays and
then check, which arrays are completely zero in order to estimate the
number of channels (very expensive). 

The goal is actually being able to seek in very large files, while
reading directly from disk. Having to read the whole files and even more
write them to memory would be way too slow and too expensive.

Anyway, thanks for the suggestion.

Roman








More information about the Pd-list mailing list