Compiling the OpenAL library
OpenAL is a cross-platform audio library used in many gaming engines. Here are some notes on how to build it for Android.
Getting ready
Download the source code of the Martins Mozeiko port from his page: http://pielot.org/2010/12/14/openal-on-android/.
The home page of the library is as follows: http://github.com/AerialX/openal-soft-android.
How to do it...
- To render the generated, or saved, audio stream we use the OpenAL library, which is compiled using the standard
Android.mk
andApplication.mk
configuration files included in the accompanying materials. - The Android port of the library is actually a wrapper made by Martins Mozeiko for the Android Java class
android.media.AudioTrack
using the JNI. The code is licensed under the GNU Library General Public License and is included in the book’s supplementary materials.
How it works…
The minimalistic source code to initialize and deinitialize OpenAL looks as follows:
ALCdevice* Device = alcOpenDevice( NULL...