Difference between revisions of "OpenAL"
Jump to navigation
Jump to search
(Initial text) |
|||
(19 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
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. |
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 [[ |
+ | 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. |
The sounds must be provided in the form of samples; there is no support for MIDI. |
||
Line 10: | Line 10: | ||
== Installation == |
== Installation == |
||
− | Download the OpenAL [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/OpenAL package from Hackage] |
||
− | or with [[Darcs]]: |
||
− | darcs get http://darcs.haskell.org/packages/OpenAL/ |
||
+ | * Hackage: https://hackage.haskell.org/package/OpenAL |
||
⚫ | |||
+ | * Repository: git clone https://github.com/haskell-openal/OpenAL |
||
− | 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: |
||
− | C:\usr\local\include |
||
⚫ | |||
− | 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: |
||
⚫ | |||
− | |||
− | As you will need this variable more often, it is best to [http://support.microsoft.com/kb/310519 set it globally]. |
||
− | Copy the directory include\AL from the package to |
||
− | C:\usr\local\include\AL |
||
+ | Before installing the Haskell package, you need to install the C++ package of OpenAL: |
||
+ | * download http://openal.org/downloads/oalinst.zip |
||
+ | * unzip it |
||
+ | * run oalinst.exe; this installs OpenAL32.dll in your system directory |
||
+ | * to find find out where OpenAL32.dll has gone, give command |
||
+ | :<code>where OpenAL32.dll</code> |
||
+ | :(You will need this later, when you distribute your application.) |
||
+ | * download the development package from http://www.openal-soft.org/#download |
||
+ | * unzip this to, for example, <code>C:\Libraries</code> |
||
+ | * Set environment variables as follows: |
||
+ | <pre> |
||
+ | Set LIBRARY_DIR=C:\Libraries |
||
⚫ | |||
+ | Set LIBRARY_PATH=%LIBRARY_DIR%\openal-soft-1.16.0-bin\libs\Win32 |
||
+ | </pre> |
||
+ | :If you need these variables more often, set them [http://www.computerhope.com/issues/ch000549.htm permanently]. |
||
=== For all platforms === |
=== For all platforms === |
||
− | See [[Cabal/How to install a Cabal package | How to install a Cabal package]]. |
||
+ | Give command <code>cabal install OpenAL</code> |
||
== Tutorials == |
== Tutorials == |
||
− | There are several tutorials for |
+ | There are several OpenAL tutorials for other programming languages: |
− | *[http://www.edenwaith.com/products/pige/tutorials/openal.php OpenAL Tutorial at Edenwaith] |
+ | * [http://www.edenwaith.com/products/pige/tutorials/openal.php OpenAL Tutorial at Edenwaith] (C) |
− | *[http:// |
+ | * [http://pielot.org/2010/12/14/openal-on-android/ OpenAL on Android] (Java) |
+ | * [http://lwjgl.org/wiki/index.php?title=Main_Page The LWJGL Wiki] (Java) |
||
+ | * [http://java.net/projects/joal-demos/ Java OpenAL demos] |
||
− | == |
+ | == Examples == |
+ | |||
− | [http:// |
+ | * [http://code.haskell.org/OpenAL/OpenAL/examples/test/TestDevice.hs TestDevice.hs] |
+ | |||
+ | |||
+ | == Additional software == |
||
+ | |||
+ | * {{HackagePackage|id=StateVar}}: This package contains state variables, which are references in the IO monad, like IORefs or parts of the OpenGL state |
||
+ | * {{HackagePackage|id=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 |
||
+ | * {{HackagePackage|id=Tensor}} This package contains tensor data types and their instances for some basic type classes. |
||
+ | * [[OpenGL]] 3D graphics software |
||
== More information == |
== More information == |
||
− | *[http://haskell.org/ |
+ | *[http://hackage.haskell.org/packages/archive/OpenAL/latest/doc/html/Sound-OpenAL.html The API documentation] |
− | *[http://www.openal.org/ |
+ | *[http://www.openal-soft.org/index.html OpenAL Soft] |
+ | *[http://openal.org/ OpenAL.org] |
||
− | *[http://developer.creative.com/ Creative Lab's developer site] |
||
− | *[http:// |
+ | *[http://jerli.info/docu/Master_1/Son/OpenAL_Programmers_Guide.pdf The OpenAL programmer's guide] |
− | *[http://en.wikipedia.org/wiki/Openal |
+ | *[http://en.wikipedia.org/wiki/Openal Wikipedia] |
− | *[http://www. |
+ | *[http://www.noeska.com/doal/tutorials.aspx Delphi OpenAL tutorial] |
+ | *[https://jogamp.org/joal-demos/www/ JOAL OpenAL Tutorials] |
||
− | |||
+ | *Devmaster Forum: [http://forum.devmaster.net/t/openal-lesson-1-simple-static-sound/2888 OpenAL Lesson 1] [http://forum.devmaster.net/t/openal-lesson-2-looping-and-fadeaway/2889 2] [http://forum.devmaster.net/t/openal-lesson-3-multiple-sources/2890 3] [http://forum.devmaster.net/t/openal-lesson-4-the-alc/2891 4] [http://devmaster.net/p/2892/openal-lesson-5-sources-sharing-buffers 5] [http://forum.devmaster.net/t/openal-lesson-6-advanced-loading-and-error-handles/2893 6] [http://forum.devmaster.net/t/openal-lesson-7-the-doppler-effect/2894 7] [http://forum.devmaster.net/t/openal-lesson-8-oggvorbis-streaming-using-the-source-queue/2895 8] |
||
== For questions == |
== For questions == |
||
+ | |||
− | *[http://haskell.org/mailman/listinfo/haskell-cafe |
+ | *[http://www.haskell.org/mailman/listinfo/haskell-cafe The Haskell Cafe mailing list] |
*[http://opensource.creative.com/mailman/listinfo/openal The OpenAL mailing list (non-Haskell)] |
*[http://opensource.creative.com/mailman/listinfo/openal The OpenAL mailing list (non-Haskell)] |
||
+ | [[Category:3D]] |
||
+ | [[Category:Games]] |
||
[[Category:Music]] |
[[Category:Music]] |
||
[[Category:Packages]] |
[[Category:Packages]] |
||
+ | [[Category:User interfaces]] |
||
+ | [[Category:Libraries]] |
Latest revision as of 15:47, 13 October 2015
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.
Installation
- Hackage: https://hackage.haskell.org/package/OpenAL
- Repository: git clone https://github.com/haskell-openal/OpenAL
Windows specific actions
Before installing the Haskell package, you need to install the C++ package of OpenAL:
- download http://openal.org/downloads/oalinst.zip
- unzip it
- run oalinst.exe; this installs OpenAL32.dll in your system directory
- to find find out where OpenAL32.dll has gone, give command
where OpenAL32.dll
- (You will need this later, when you distribute your application.)
- download the development package from http://www.openal-soft.org/#download
- unzip this to, for example,
C:\Libraries
- Set environment variables as follows:
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 permanently.
For all platforms
Give command cabal install OpenAL
Tutorials
There are several OpenAL tutorials for other programming languages:
- OpenAL Tutorial at Edenwaith (C)
- OpenAL on Android (Java)
- The LWJGL Wiki (Java)
- Java OpenAL demos
Examples
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
- The API documentation
- OpenAL Soft
- OpenAL.org
- The OpenAL programmer's guide
- Wikipedia
- Delphi OpenAL tutorial
- JOAL OpenAL Tutorials
- Devmaster Forum: OpenAL Lesson 1 2 3 4 5 6 7 8