Personal tools

OpenAL

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
m (Installation)
(Windows specific actions)
Line 17: Line 17:
 
=== Windows specific actions ===
 
=== Windows specific actions ===
  
If you downloaded from Hackage, you might want to know, [[How to unpack a tar file in windows]]
+
Before installing the Haskell package, you need to install the C-package of OpenAL:  
 
+
* download http://openal.org/downloads/oalinst.zip
Create a directory for include files, without spaces in the name, for example:
+
* unzip it
  C:\usr\local\include
+
* run oalinst.exe; this installs OpenAL32.dll in your system directory
 
+
* to find find out where OpenAL32.dll has gone, give command
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:
+
:<code>where OpenAL32.dll</code>
  Set C_INCLUDE_PATH=C:\usr\local\include
+
:(You will need this later, when you distribute your application.)
 
+
* download the development package from http://www.openal-soft.org/#download
As you will need this variable more often, it is best to [http://support.microsoft.com/kb/310519 set it globally].
+
* unzip this to, for example, <code>C:\Libraries</code>
Copy the directory include\AL from the package to
+
* Set environment variables as follows:
  C:\usr\local\include\AL
+
<pre>
 
+
Set LIBRARY_DIR=C:\Libraries
 +
Set C_INCLUDE_PATH=%LIBRARY_DIR%\openal-soft-1.16.0-bin\include
 +
Set LIBRARY_PATH=%LIBRARY_DIR%\openal-soft-1.16.0-bin\libs\Win32
 +
</pre>
 +
:If you need these variables more often, [http://support.microsoft.com/kb/310519 set them globally].
 +
* Give command <code>cabal install OpenAL</code>
  
 
=== For all platforms ===
 
=== For all platforms ===

Revision as of 14:19, 13 October 2015

Contents

1 Introduction

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.


2 Installation


2.1 Windows specific actions

Before installing the Haskell package, you need to install the C-package of OpenAL:

where OpenAL32.dll
(You will need this later, when you distribute your application.)
Set LIBRARY_DIR=C:\Libraries
Set C_INCLUDE_PATH=%LIBRARY_DIR%\openal-soft-1.16.0-bin\include
Set LIBRARY_PATH=%LIBRARY_DIR%\openal-soft-1.16.0-bin\libs\Win32
If you need these variables more often, set them globally.
  • Give command cabal install OpenAL

2.2 For all platforms

See How to install a Cabal package.

3 Tutorials

There are several OpenAL tutorials for other programming languages:


4 Examples


5 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


6 More information

7 For questions