From: mdw@db.TC.Cornell.EDU (Matt Welsh) Subject: Re: ANNOUNCE: Sound for Linux 0.99 (Sound driver v 0.4) Date: Tue, 15 Dec 1992 17:06:44 GMT
In article <9235020.16960@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
>arumble@extro.ucc.su.OZ.AU (Anthony Rumble) writes:
>>kenc@sol.acs.unt.edu (Ken Corey - Operator) writes:
>>>(Also, there's a sneaky little voice in the back of my head
>>>thinking..."Wow..rogue would be *cool* with a few sound effects...")
>>
>>Very easy to do.. Just make the source code fork() and
>>cat the sample to /dev/dsp..
>
>What about just
> system("cat sample > /dev/dsp &");
That's pretty hefty overhead for playing a sound effect within a
program. If you want it to be faster, open /dev/dsp by hand and send
the sample directly to it with a series of writes. This way you don't
create a whole new process (or, in this case, two processes) for
playing the sound effect.
mdw
-- Matt Welsh mdw@tc.cornell.edu Cornell Theory Center "Go on, emote! I was raised on thought balloons!"