[chuck-users] reading random sample

Robert Poor rdpoor at gmail.com
Thu Jan 29 19:14:50 EST 2015

I haven't done this in a while, so I don't have the code at my fingertips,
but I used to read in sound files and then 'preheat' them by accessing at
least one sample.  This would force them to get paged in, and (if you had
enough physical memory) would reduce the overhead when you actually went to
access them.

On Thu Jan 29 2015 at 9:50:38 AM Julian Faust <julian.faust at gmail.com>

> If you know in advance what set of files to choose from, you could start
> by reading in a text file with all the file paths then make the random
> selection in chuck. This avoids system calls, which can mess with the
> timing of your real-time application since the chuck VM misses the time
> spent doing the system call (i.e. Std.system(“sleep 1”) causes mayhem). But
> if you want to be able to add files to a directory on the fly I think you
> have to do the system call. Just be aware of the timing issue - maybe it
> can be done in a thread.
> -Julian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20150130/cc3ca5ed/attachment.html>

More information about the chuck-users mailing list