Re: [Freeciv-Dev] adding sound
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, May 18, 1999 at 11:44:51PM +0200, Bastian Hecht was heard to say:
> Thanks for the advice! I'm quite new to unix programming, so I didn't know
> the possibility.
> I wrote a small piece of code and it works fine. I'm going to try to run
^^^^^^^^^^^^^^^^^^^^^^^
> it parallel to the client
^^^^^^^^^^^^^^^^^^^^^^^^^
> program, so that the user needn't wait until the sound is completely
^^^^^^^
> played.
> So far, I added some combat sounds and a sound, when a city is built.
> Looks quite easy..
>
> basti
[putting on flamesuit]
Has anyone considered esound? This does pretty much what you're trying to
do already, and since it's not written for a specific program you don't lock
everyone else out of using the sound device (just programs that don't know
about it and that don't work with the wrapper script--that's not many and in
fact esd can unlock the audio device while it's not playing noises). I know
that it's less portable than freeciv, but it should be able to work on most
unicies at least (basti mentioned that he's just doing this for unicies?).
Actually a better method would be to write a generic set of calls to play
sounds..eg.. (warning: silly interface coming up, please make the real thing
much more sophisticated than this)
sounds.h:
#define ELEPHANT_NOISE 12
...
void sound_activate(int sound_num);
someotherfile.c:
/* Elephant is attacking */
sound_activate(ELEPHANT_NOISE);
and then use configure checks to enable/disable various sound backends. ...he
says without writing a line of code...
Daniel
--
It is hard to think of anything less sentient than a pumpkin.
-- Terry Pratchett, _Witches Abroad_
|
|