c guru (bit off topic)
Andy Sloane
andy at guildsoftware.com
Tue Sep 21 17:51:25 CEST 1999
On Tue, Sep 21, 1999 at 12:01:11PM +0200, Martin Czech wrote:
> Could one of the c gurus on this list please enlighten me:
>
> 1. I'm looking for a way to transfer files rapidly into dram.
> There must be some kind of block-transfer stuff, but how
> is this encoded in the librarys? fscanf is slow.
You're looking for fread().
fread(void *ptr, size_t num, size_t size, FILE *fp);
if you want to read a 4k block, do something like char buf[4096];
fread(buf, 4096, 1, fp);
> 2. Does anyone have a (preferable gnu-c) piece of code,
> that dumps memory into a sound card (soundblaster)?
> That way I wouldn't need to read the result file
> into Cool-Edit or something each time a computation
> is done.
That's highly operating system dependent. under linux, it's really easy.
under windows, it's less easy. under dos, it's not. I have code for all
three, of course, but it'll take longer to dig out and wipe the dust off my
old DOS stuff. :)
-Andy.
More information about the Synth-diy
mailing list