[PD] How to access audio files from disk randomly?

James Dunn james at 4thharmonic.com
Tue Dec 8 12:47:47 CET 2009

Hi Roman,

I just installed readanysf~ again on my new install of Ubuntu 9.10 and 
had no problems. Obviously you need gavl and gmerlin-avdecode. I also 
had to install libgmerlin0.
It doesn't return the number of channels but you can specify a number 
(default is 2) and it will upmix or downmix all channels accordingly.
I don't know about the iostream.h error.


Quoth Roman Haefeli, on 07/12/09 21:55:
> Hi James
> Thanks for that hint. I actually _wanted_ to check [readanysf~], but
> failed to compile it. But yeah, it would cover some of the given
> requirments. Unfortunately, it does not seem to return the number of
> channels of an audio file. Since i cannot test myself now: Is it able at
> all to play multi-channel-files with a higher number of channels than 2?
> I don't see any errors, when running ./configure. However, 'make' fails
> pretty early:
> roman at yoyo2:~/pd-svn/externals/august/readanysf~$ make
> make  all-recursive
> make[1]: Entering directory
> `/home/roman/pd-svn/externals/august/readanysf~'
> Making all in src
> make[2]: Entering directory
> `/home/roman/pd-svn/externals/august/readanysf~/src'
> g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include/
> -I/usr/local/lib/pd/flext/ -I../include/  -DUNIX -Wno-deprecated -Wall
> -Wimplicit -Wunused -Wmissing-prototypes -O1  -DFLEXT_SYS=2
> -I/usr/local/include/flext  -DREAD_VORBIS   -DREAD_MAD  -DREAD_FLAC -MT
> Input.o -MD -MP -MF .deps/Input.Tpo -c -o Input.o Input.cpp
> cc1plus: warning: command line option "-Wmissing-prototypes" is valid
> for Ada/C/ObjC but not for C++
> Input.cpp:2:22: error: iostream.h: No such file or directory
> make[2]: *** [Input.o] Error 1
> make[2]: Leaving directory
> `/home/roman/pd-svn/externals/august/readanysf~/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory
> `/home/roman/pd-svn/externals/august/readanysf~'
> make: *** [all] Error 2
> There are several packages delivering a file 'iostream.h', but none of
> them puts it directly to /usr/include. I also did install all the
> pre-requisites of readanysf~: libmad, libsamplerate, libflac, libogg,
> working flext.
> Help would be much appreciated.
> Roman
> On Mon, 2009-12-07 at 16:43 +0000, James Dunn wrote:
>> What about readanysf~? You can send it [seek $1( and you can also get 
>> the file length in seconds out with [route length]
>> Quoth Roman Haefeli, on 06/12/09 23:57:
>>> Hi all
>>> Yeah, it's never too late for basic questions. Basically i would like to
>>> create file player patch, that let's you pick a soundfile (be it a wav)
>>> of any number of channels and a bit depth currently supported by
>>> [readsf~] and it should be able to play from any position between the
>>> start and the end of the file. 
>>> Usually i used a kludge by using [soundfiler] in order to get the number
>>> of sample frames of the file and then i calculated the number of bytes
>>> to be skipped in order to be able to let [readsf~] play the file from a
>>> random position. However, this only works when the actual header size of
>>> the file is constant (i.e. known and the same for every file; ok, when
>>> the header sizes would be known, they wouldn't need to be the same for
>>> all files, but you get the point) and when you know beforehand the bit
>>> depth of the file(s), since [readsf~] reads it correctly, but doesn't
>>> tell you about it.
>>> Now, i would like to be able to play wav files correctly with arbitrary
>>> (unkown) bit depths and arbitrary (unkown) number of channels. Also, i
>>> am looking for a way to be able to load both, simple RIFF WAV and so
>>> called 'Broadcast WAV' files (the ones with a 'bext' header signature). 
>>> I also tried [wavinfo] from ext13. However, this seems to work only with
>>> the former (simple) format, but not with broadcast wav-files. Funny
>>> enough, [readsf~] seems to have everything needed built-in, since it
>>> reads both formats correctly, it just does not expose those functions to
>>> the pd patch (as this unfortunately is often the problem with many
>>> object classes). 
>>> Any idea or pointers to other externals welcome!
>>> Roman
>>> _______________________________________________
>>> Pd-list at iem.at mailing list
>>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>> _______________________________________________
>> Pd-list at iem.at mailing list
>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20091208/81d7e2d9/attachment.htm>

More information about the Pd-list mailing list