Search code examples
c++androidopenal

Is there an equivalent to OpenAL <alc.h> in OpenSL ES?


I made a game in C++ with OpenGL ES rendering and using OpenAL for sound. To make it work on iPhone I could not use ALUT so I use only "al.h" and "alc.h".

I now try to build my game with the last Android SDK, that supports native applications and added sound support with OpenSL ES. (I believed OpenSL ES was to OpenAL what OpenGL ES is to OpenGL.)

I would like to know if by chance there is an equivalent to the "alc.h" file for OpenSL ES :

#if defined (MYAPP_IOS)
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#elif defined (MYAPP_ANDROID)
#include <EGL/egl.h>
    // alc.h equivalent for OpenSL ES here ?
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif

If not, does anybody know a way to handle context and device in OpenSL ES in a similar way than OpenAL (or maybe a way to handle that in both without needing "alc.h" ?). The two errors Android ndk-build returns are of that type :

error: ISO C++ forbids declaration of 'ALCcontext' with no type


Solution

  • I found this on the site that seemed to have what you're looking for: Android OpenAL?

    Looks like someone was able to compile OpenAL for Android. Hopefully this can get you started!