I think there is iemlib/soundfile_info.
.hc
On Nov 3, 2011, at 4:07 PM, Samuel Burt wrote:
How do I get the length of an aif file without using soundfiler?
I've got an application that loads random aif and wav files from a chosen directory when triggered. I was using soundfiler to load a sound into an array where I could play it back with variable speed. When I ran two of these applications simultaneously, I noticed audio dropouts every time soundfiler would load a new sound. Soundfiler is not threaded, so I went looking for other people's solutions. Someone mentioned that Miller had suggested using readsf~ in an upsampled subpatch to read a sound into an array quickly. When you do this, how do you know how long to make your array to load in the sound? I suppose I could just make a preset length. I did see posts about wavinfo (buggy) and soundfile_info (only for wav files).
Is there a way to get the sample length of aifs in Pd without soundfiler?
This is an application I develop for someone else. It would not be appropriate for me to ask him to go through his entire collection of samples and change all the aifs to wavs. If I make the array an arbitrary length, he may be surprised when he starts trying to load in 2 minute files.
OS 10.6.8 Pd 0.42.5-extended-rc5
Thanks, Samuel Burt
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra