Hello everyone, after spending (a lot of) time on OpenAL-Soft and LibSndFile, I married them and wrote ALSound an interface to ease playing, recording and mixing audio under FreePascal/Lazarus.
OpenAL-Soft is an improved software implementation of OpenAL, actively maintained by Christopher Robinson (
https://github.com/kcat/openal-soft).
LibSndFile is a C library for reading and writing audio files (
https://github.com/libsndfile/libsndfile).
You hardly have to know these libraries to use ALSound.
ALSound is also compatible with old version of OpenAL but advanced features may not work.
Tested under Linux and Windows, i386 and x86-64.
May work on other platforms with the appropriate compiled libraries.
Typical use
uses ..., ALSound;
var
FPlaybackContext: TALSPlaybackContext;
FSound: TALSSound;
...
FPlaybackContext := ALSManager.CreateDefaultPlaybackContext;
FSound := FPlaybackContext.AddStream( 'PathToMusic'+DirectorySeparator+'myMusic.ogg');
FSound.Loop := True;
FSound.Play;
...
FPlaybackContext.Free;
Code can be found at
https://github.com/Lulu04/ALSoundThanks to Fred van Stappen, the author of United OpenLib of Sound (UOS) (
https://github.com/fredvs/uos) who wrote pascal binding for LibSndFile and PortAudio. This was a good example for me to write pascal binding for OpenAL-Soft and LibSndFile.