[fpc-pascal] playing sound files (linux and windows)
Michalis Kamburelis
michalis.kambi at gmail.com
Tue Jun 15 21:51:23 CEST 2010
Graeme Geldenhuys wrote:
> I can't find an example for loading a .wav file.
[...]
>
> Any hints or sample code. The sample included in FCL 2.4.1 loads MAD, A52,
> OGG and ModPlug only. Google revealed a tutorial using AlutLoadWavFile(),
> but that is in the "unofficial utilities library", it's not part of the
> standard OpenAL 1.1 spec, and not included in Linux.
>
ALUT is included in Linux, although usually in a separate package
(libalut*). ALUT is "somewhat" official, that is it's development is
coordinated on the same mailing list and, although separate to openal,
I don't think it will die so soon :) ALUT spec is on
http://connect.creativelabs.com/openal/Documentation/The%20OpenAL%20Utility%20Toolkit.htm
That said, loading uncompressed WAV files is quite easy, you can see my
code on
https://vrmlengine.svn.sourceforge.net/svnroot/vrmlengine/trunk/kambi_vrml_game_engine/src/audio/soundfile.pas
Look for TSoundWAV.CreateFromStream method.
Michalis
More information about the fpc-pascal
mailing list