Permalink
Browse files

Added OpenAL 1.1 audio on Android with 3D audio and effects via OpenS…

…LES backend for openal-soft 1.14.
  • Loading branch information...
1 parent cc40fee commit cb054df7e6ba6b5f0e510b2014ccf2540cf33e6b @seanpaultaylor seanpaultaylor committed May 1, 2012
@@ -104,6 +104,16 @@
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;
+
+#elif defined(__ANDROID__)
+
+ /* Android */
+# include <inttypes.h>
+ typedef int16_t ogg_int16_t;
+ typedef uint16_t ogg_uint16_t;
+ typedef int32_t ogg_int32_t;
+ typedef uint32_t ogg_uint32_t;
+ typedef int64_t ogg_int64_t;
#elif defined (__EMX__)
Binary file not shown.
Binary file not shown.
@@ -17,6 +17,8 @@ SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
+VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
+OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
# gameplay
LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
@@ -46,6 +48,20 @@ LOCAL_MODULE := libbullet
LOCAL_SRC_FILES := libbullet.a
include $(PREBUILT_STATIC_LIBRARY)
+# libvorbis
+LOCAL_PATH := $(VORBIS_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libvorbis
+LOCAL_SRC_FILES := libvorbis.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libOpenAL
+LOCAL_PATH := $(OPENAL_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libOpenAL
+LOCAL_SRC_FILES := libOpenAL.a
+include $(PREBUILT_STATIC_LIBRARY)
+
# sample00-mesh
LOCAL_PATH := $(SAMPLE_PATH)
include $(CLEAR_VARS)
@@ -54,9 +70,9 @@ LOCAL_MODULE := sample00-mesh
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp MeshGame.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet libvorbis libOpenAL
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
@@ -17,6 +17,8 @@ SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
+VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
+OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
# gameplay
LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
@@ -46,6 +48,20 @@ LOCAL_MODULE := libbullet
LOCAL_SRC_FILES := libbullet.a
include $(PREBUILT_STATIC_LIBRARY)
+# libvorbis
+LOCAL_PATH := $(VORBIS_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libvorbis
+LOCAL_SRC_FILES := libvorbis.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libOpenAL
+LOCAL_PATH := $(OPENAL_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libOpenAL
+LOCAL_SRC_FILES := libOpenAL.a
+include $(PREBUILT_STATIC_LIBRARY)
+
# sample00-longboard
LOCAL_PATH := $(SAMPLE_PATH)
include $(CLEAR_VARS)
@@ -54,9 +70,9 @@ LOCAL_MODULE := sample01-longboard
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp LongboardGame.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet libvorbis libOpenAL
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
@@ -17,6 +17,8 @@ SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
+VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
+OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
# gameplay
LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
@@ -46,6 +48,20 @@ LOCAL_MODULE := libbullet
LOCAL_SRC_FILES := libbullet.a
include $(PREBUILT_STATIC_LIBRARY)
+# libvorbis
+LOCAL_PATH := $(VORBIS_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libvorbis
+LOCAL_SRC_FILES := libvorbis.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libOpenAL
+LOCAL_PATH := $(OPENAL_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libOpenAL
+LOCAL_SRC_FILES := libOpenAL.a
+include $(PREBUILT_STATIC_LIBRARY)
+
# sample02-spaceship
LOCAL_PATH := $(SAMPLE_PATH)
include $(CLEAR_VARS)
@@ -54,9 +70,9 @@ LOCAL_MODULE := sample02-spaceship
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp SpaceshipGame.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet libvorbis libOpenAL
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
@@ -17,6 +17,8 @@ SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
+VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
+OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
# gameplay
LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
@@ -46,6 +48,20 @@ LOCAL_MODULE := libbullet
LOCAL_SRC_FILES := libbullet.a
include $(PREBUILT_STATIC_LIBRARY)
+# libvorbis
+LOCAL_PATH := $(VORBIS_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libvorbis
+LOCAL_SRC_FILES := libvorbis.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libOpenAL
+LOCAL_PATH := $(OPENAL_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libOpenAL
+LOCAL_SRC_FILES := libOpenAL.a
+include $(PREBUILT_STATIC_LIBRARY)
+
# sample03-character
LOCAL_PATH := $(SAMPLE_PATH)
include $(CLEAR_VARS)
@@ -54,9 +70,9 @@ LOCAL_MODULE := sample03-character
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp CharacterGame.cpp Gamepad.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet libvorbis libOpenAL
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
@@ -17,6 +17,8 @@ SAMPLE_PATH := $(call my-dir)/../../src
LIBPNG_PATH := $(call my-dir)/../../../../external-deps/libpng/lib/android/arm
ZLIB_PATH := $(call my-dir)/../../../../external-deps/zlib/lib/android/arm
BULLET_PATH := $(call my-dir)/../../../../external-deps/bullet/lib/android/arm
+VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/arm
+OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
# gameplay
LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
@@ -46,6 +48,20 @@ LOCAL_MODULE := libbullet
LOCAL_SRC_FILES := libbullet.a
include $(PREBUILT_STATIC_LIBRARY)
+# libvorbis
+LOCAL_PATH := $(VORBIS_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libvorbis
+LOCAL_SRC_FILES := libvorbis.a
+include $(PREBUILT_STATIC_LIBRARY)
+
+# libOpenAL
+LOCAL_PATH := $(OPENAL_PATH)
+include $(CLEAR_VARS)
+LOCAL_MODULE := libOpenAL
+LOCAL_SRC_FILES := libOpenAL.a
+include $(PREBUILT_STATIC_LIBRARY)
+
# sample04-particles
LOCAL_PATH := $(SAMPLE_PATH)
include $(CLEAR_VARS)
@@ -54,9 +70,9 @@ LOCAL_MODULE := sample04-particles
LOCAL_SRC_FILES := ../../../gameplay/src/gameplay-main-android.cpp ParticlesGame.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2 -lOpenSLES
-LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../gameplay/src"
+LOCAL_CFLAGS := -D__ANDROID__ -I"../../../external-deps/bullet/include" -I"../../../external-deps/libpng/include" -I"../../../external-deps/oggvorbis/include" -I"../../../external-deps/openal/include" -I"../../../gameplay/src"
-LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet
+LOCAL_STATIC_LIBRARIES := android_native_app_glue libgameplay libpng libzlib libbullet libvorbis libOpenAL
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
@@ -17,7 +17,7 @@ LOCAL_PATH := $(call my-dir)/../../src
include $(CLEAR_VARS)
LOCAL_MODULE := libgameplay
LOCAL_SRC_FILES := AbsoluteLayout.cpp Animation.cpp AnimationClip.cpp AnimationController.cpp AnimationTarget.cpp AnimationValue.cpp AudioBuffer.cpp AudioController.cpp AudioListener.cpp AudioSource.cpp BoundingBox.cpp BoundingSphere.cpp Bundle.cpp Button.cpp Camera.cpp CheckBox.cpp Container.cpp Control.cpp Curve.cpp DebugNew.cpp DepthStencilTarget.cpp Effect.cpp FileSystem.cpp FlowLayout.cpp Font.cpp Form.cpp FrameBuffer.cpp Frustum.cpp Game.cpp gameplay-main-android.cpp Image.cpp Joint.cpp Label.cpp Layout.cpp Light.cpp Material.cpp MaterialParameter.cpp Matrix.cpp Mesh.cpp MeshBatch.cpp MeshPart.cpp MeshSkin.cpp Model.cpp Node.cpp ParticleEmitter.cpp Pass.cpp PhysicsCharacter.cpp PhysicsCollisionObject.cpp PhysicsCollisionShape.cpp PhysicsConstraint.cpp PhysicsController.cpp PhysicsFixedConstraint.cpp PhysicsGenericConstraint.cpp PhysicsGhostObject.cpp PhysicsHingeConstraint.cpp PhysicsMotionState.cpp PhysicsRigidBody.cpp PhysicsSocketConstraint.cpp PhysicsSpringConstraint.cpp Plane.cpp PlatformAndroid.cpp Properties.cpp Quaternion.cpp RadioButton.cpp Ray.cpp Rectangle.cpp Ref.cpp RenderState.cpp RenderTarget.cpp Scene.cpp SceneLoader.cpp Slider.cpp SpriteBatch.cpp Technique.cpp TextBox.cpp Texture.cpp Theme.cpp ThemeStyle.cpp Transform.cpp Vector2.cpp Vector3.cpp Vector4.cpp VertexAttributeBinding.cpp VertexFormat.cpp VerticalLayout.cpp
-LOCAL_CFLAGS := -D__ANDROID__ -I"../../external-deps/bullet/include" -I"../../external-deps/libpng/include"
+LOCAL_CFLAGS := -D__ANDROID__ -I"../../external-deps/bullet/include" -I"../../external-deps/libpng/include" -I"../../external-deps/oggvorbis/include" -I"../../external-deps/openal/include"
LOCAL_STATIC_LIBRARIES := android_native_app_glue
include $(BUILD_STATIC_LIBRARY)

0 comments on commit cb054df

Please sign in to comment.