Updated android backend.
[openal-soft/android.git] / README-ANDROID
blob9a8c5fcb4b9bdb99c0db40f65cc979e39fe5394d
1 OpenAL Soft for Android
2 =======================
4 OpenAL Soft on Android is supported only starting from 1.5 version.
6 To build OpenAL Soft for Android you must have install SDK and NDK (at least r4) installed.
8 Go to Android directory and execute
10 $ PATH/TO/NDK/ndk-build
12 This will build libopenal.so and libexample.so under libs subdirectory. 
13 You can use libopenal.so in your own projects. If you want to build Java example, then
14 first update project to your local SDK installation:
16 $ PATH/TO/SDK/tools/android update project --path . --target android-3
18 Run this only once (it will create local.properties file, and update default.properties file).
19 After that use ant to compile and package Java code:
21 $ ant debug
23 Now you will find OpenAL-debug.apk under bin directory. Don't worry that it is debug. All the
24 decoding will be done from native C code from jni/example.c file.
25 Install it to your device:
27 $ adb install -r bin/OpenAL-debug.apk
29 And run it either manually, or with am from command-line:
31 $ adb shell am start -a android.intent.action.MAIN -n net.strangesoft.kcat/.OpenAL
33 Example will decode ogg file using Tremolo library and will play audio with streaming source.
34 Tremolo library is heavily optimized Tremor library (integer only Vorbis decoder).
35 It is BSD licensed: http://wss.co.uk/pinknoise/tremolo/
37 You can open DDMS to watch debug logging or any error messages if there is any. You can filter
38 out OpenAL error/info messages with tag "OpenAL".
40 Example is using trash80 song Three/Four Robot Slojam from http://trash80.net/music
41 It is distributed under Creative Commons license.
43 Take into consideration that Android mobile devices is not as powerful as your desktop, so do
44 not put on OpenAL too many work. Use low sample rate (22050 or better 11025, if not lower) data.
45 Also create context by specifying lower sample rrate. Take into consideration that not all
46 Android devices have hardware floting point calculations available. Many of them will execute
47 floating point calculations in software which is slower.
50 Martins Mozeiko
51 martins.mozeiko@gmail.com