Author Topic: ALSound  (Read 217 times)


  • Full Member
  • ***
  • Posts: 171
« on: September 01, 2022, 11:48:39 am »
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 (
LibSndFile is a C library for reading and writing audio files (
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

Code: Pascal  [Select][+][-]
  1. uses ..., ALSound;
  3. var
  4.   FPlaybackContext: TALSPlaybackContext;
  5.   FSound: TALSSound;
  6. ...
  7.   FPlaybackContext := ALSManager.CreateDefaultPlaybackContext;
  8.   FSound := FPlaybackContext.AddStream( 'PathToMusic'+DirectorySeparator+'myMusic.ogg');
  9.   FSound.Loop := True;
  10.   FSound.Play;
  11. ...
  12.   FPlaybackContext.Free;

Code can be found at

Thanks to Fred van Stappen, the author of United OpenLib of Sound (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.
wishing you a nice life


TinyPortal © 2005-2018