jworms.openal.* Package summary
The listener who is listening to OpenAL soures (OpenALSource). The major property of OpenALListener is it's position.
The OpenALSource plays the sound (OpenALWave).
OpenALUtils is a summary of static functions to initalize and exit OpenAL.
OpenALWave is used to load .wav files that then can be played by an OpenALSource.
Basic OpenAL tutorial
This tutorial shows the use of multiple OpenAL sources to play different sounds simultaneously. After compiling and starting the OpenALTutorial.java you should hear footsteps on the left side and every 2 seconds an explosion. The explosion will move from right to left (in 5 steps) and then jump to the right side again. If you get an exception starting the program please check that "tutorial/...wav" sound files are located in the working directory.
Now we are going to explain the most important parts of the program.
1. Initializing OpenAL:
2. Loading sound files:
3. Set listener position:
4. Generate sound files:
5. Create OpenAL sources and play the sound:
6. Dispose OpenAL:
Download and installation
To compile and run the tutorial you need Java Runtime Environment 1.4.2 and the LWJGL binaries for your operating system.
By clicking on a download link you agree to the disclaimer and distributing terms of Vermin ExTerminator (see download section)!
Full source code of OpenALTutorial.java.