[fpc-pascal] playing sound files (linux and windows)

Ingemar Ragnemalm ingemar at ragnemalm.se
Mon Jun 14 19:34:46 CEST 2010


dmitry boyarintsev <skalogryz.lists at gmail.com> wrote:

On Mon, Jun 14, 2010 at 5:37 PM, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:

>> Has anybody managed to play sound files under both Linux and Windows?
>> Does FPC have a cross-platform API or FCL class for this?

>I'd offer using OpenAL, however it requires proper libraries to be
>installed on Linux (afaik installed by default in all modern desktop
>distribs), and proper .dlls available for Windows.

>There's proper example in FCL how to use OpenAL to play .wav, .ogg .mp3 files.

I second that, AL is worth considering. It was very easy for me to use, at least once I found a decent WAV loader.

I have a little "OpenAL kit" for the Mac here:

http://www.ragnemalm.se/lightweight/openal_fpc.zip

On the Mac it it great: always installed, much better API than Core Audio, and portable. Havn't tried it on Linux och Windows though. And there is one problem that AL doesn't help me with (apart from loading WAV) and that is to play music. Uncompressed sound isn't useful for music. I can play that with Quicktime, but I'd like to use something cross-platform.


/Ingemar





More information about the fpc-pascal mailing list