[fpc-pascal] Re: Playing sounds with standard components
Michalis Kamburelis
michalis.kambi at gmail.com
Mon Jun 11 20:27:07 CEST 2012
luciano de souza wrote:
> I took a look in Openal examples. I need to confess that I expected
> something easier. Perhaps, something like:
>
> PlaySound('file.wav', 0)
>
You need to wrap OpenAL a little to get something so simple.
In my Castle Game Engine (http://castle-engine.sourceforge.net/), I have
SoundEngine wrapper, with which you can play sound like
Buffer := SoundEngine.LoadBuffer(FileName);
SoundEngine.PlaySound(Buffer, false, ...);
See working example in SVN on
http://svn.code.sf.net/p/castle-engine/code/trunk/castle_game_engine/examples/audio/alplay.lpr
You may want to look at the source (LGPL) to see how it's done :)
Michalis
More information about the fpc-pascal
mailing list