[fpc-pascal] Re: Playing sounds with standard components
ludo.brands at free.fr
Mon Jun 11 20:22:14 CEST 2012
> I took a look in Openal examples. I need to confess that I
> expected something easier. Perhaps, something like:
> PlaySound('file.wav', 0)
> In MMSystem, we have something like that, but it's not cross platform.
> The examples present hundreds of lines. It's something frightful!
> Regarding the complexity, probably is's possible to do much
> more than simply play a sound. In spite of that, it would be
> intersting to have something easier.
> The examples work with complex and for me, abstract
> structures. Which kind of content, do I need to study to
> understand Openal or SDL?
On the lazarus forum, kpjcomp made a wrapper for Openal. Haven't tested it
but his example code is as simple as:
openAl := TLazOpenAL.Create;
wav1 := TLazOpenALWavFileSource.Create('drumloop.wav');
wav1.looping := true;
wav2 := TLazOpenALWavFileSource.Create('chimes.wav');
Perhaps worth looking at.
More information about the fpc-pascal