Difference between revisions of "OpenAL"

From HaskellWiki
Jump to navigation Jump to search
(Added section "Additional software" with links to the packages StateVar, ObjectName, Tensor and OpenGL)
m (Update OpenAL darcs repository link)
Line 12: Line 12:
Download the OpenAL [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/OpenAL package from Hackage]
Download the OpenAL [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/OpenAL package from Hackage]
or with [[Darcs]]:
or with [[Darcs]]:
darcs get http://darcs.haskell.org/packages/OpenAL/
darcs get http://code.haskell.org/OpenAL/OpenAL/
=== Windows specific actions ===
=== Windows specific actions ===
Line 40: Line 40:
== Examples ==
== Examples ==
* [http://darcs.haskell.org/packages/OpenAL/examples/test/TestDevice.hs TestDevice.hs]
* [http://code.haskell.org/OpenAL/OpenAL/examples/test/TestDevice.hs TestDevice.hs]

Revision as of 08:16, 8 January 2012


OpenAL (short for Open Audio Library) is a library for creation of a virtual 3D world of sound. The application programmer can specify the location, the speed and the direction of the sources of sounds and of the listener. This is easily combined with a 3D world created with OpenGL and can very well be used to create games. The sounds must be provided in the form of samples; there is no support for MIDI.

An addition to this library is the OpenAL Utility Toolkit (ALUT). See also the Wikipedia article on OpenAL.


Download the OpenAL package from Hackage or with Darcs:

  darcs get http://code.haskell.org/OpenAL/OpenAL/

Windows specific actions

If you downloaded from Hackage, you might want to know, How to unpack a tar file in windows

Create a directory for include files, without spaces in the name, for example:


Define the environment variable C_INCLUDE_PATH and assign it the name of the include directory (the full path), for example, in a .bat file, before the build commands:

  Set C_INCLUDE_PATH=C:\usr\local\include

As you will need this variable more often, it is best to set it globally. Copy the directory include\AL from the package to


For all platforms

See How to install a Cabal package.


There are several tutorials for the C version of OpenAL:


Additional software

  • StateVar: This package contains state variables, which are references in the IO monad, like IORefs or parts of the OpenGL state
  • ObjectName: Explicitly handled object names. This tiny package contains the class ObjectName, which corresponds to the general notion of explicitly handled identifiers for API objects, e.g. a texture object name in OpenGL or a buffer object name in OpenAL
  • Tensor This package contains tensor data types and their instances for some basic type classes.
  • OpenGL 3D graphics software

More information

For questions