[PD] acquiring information about wav files

Roman Haefeli reduzierer at yahoo.de
Sat Jan 30 00:54:53 CET 2010


Yeah, but only of the part that you write into the table, which means
you have to read the whole file from disk before you know the number of
frames (and you need a huge array, when reading a huge file).

Roman

On Fri, 2010-01-29 at 11:00 -0800, William Brent wrote:
> Just for the record - soundfiler outputs the number of samples
> directly, so there's no need for [arraysize] in this kind of
> situation.  It's not mentioned directly in the help file, but that
> number box connected to soundfiler's output reports the number of
> samples.
> 
> 
> 
> On Thu, Jan 28, 2010 at 2:59 PM, Andrew Faraday <jbturgid at hotmail.com> 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.
> > Hope that helps
> >
> >> From: reduzierer at yahoo.de
> >> To: pd-list at iem.at
> >> Date: Thu, 28 Jan 2010 23:30:53 +0100
> >> Subject: [PD] acquiring information about wav files
> >>
> >> Hi all
> >>
> >> I am looking for a way to get information about WAV files in Pd,
> >> specifically the number of channels and the number of frames. I know
> >> [wavinfo], but it does not seem to work on windows ("error: could not
> >> read WAV-header" with any file I could find) and on linux it seems to
> >> read only a subset of WAV formats. It does not read from widely used
> >> broadcast format WAV files. The target platform is windows AND linux
> >> anyway in this case, so I need a portable solution.
> >>
> >> The most troubling fact is, that some Pd-vanilla classes ([soundfiler],
> >> [readsf~]) actually do retrieve the information I need, they read both,
> >> the number of frames and the number of channels correctly, with all pcm
> >> encoded wav files I tried, but - what a pity - they don't expose this
> >> information to the patch level.
> >>
> >> Hopefully I am overseeing the obvious here. Hints are very welcome.
> >>
> >> Roman
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> Pd-list at iem.at mailing list
> >> UNSUBSCRIBE and account-management ->
> >> http://lists.puredata.info/listinfo/pd-list
> >
> > ________________________________
> > Got a cool Hotmail story? Tell us now
> > _______________________________________________
> > Pd-list at iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> > http://lists.puredata.info/listinfo/pd-list
> >
> >
> 
> 
> 






More information about the Pd-list mailing list