On Thu, Dec 31, 2009 at 12:11:17PM -0800, Gary Kline wrote: > > Yeah, I views the file with od -c; but wouldn't it be much faster > to have the data file part of my test program than having to open, > read, cat thru /dev/dsp each time, close file? I stole the cat > from the K&R book, and by reading the click.h data file it seems > everything would go much faster.
Just read them all once, at start-up and store them in a buffer. You could use mmap(2), but if the sound fragments are small, that might be a waste of memory becasue mmap maps at least a page. I'll send you a utility function I've written to read files into memory off-list. Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
pgp9odeplveKI.pgp
Description: PGP signature