Question

I am looking into clearing up my confusion on how to capture and render audio using native code on the Android platform. What I've heard is that theres an API for audio called OpenSL. Is there any recommended guides and tutorials on how to use it?

Also, is there any good audio wrappers for OpenSL, such as an OpenAL wrapper or something? I've developed the audio part with OpenAL on other platforms, so it would be nice to re-use the code.

Is there limitations to OpenSL - like, something that has to be done in Java code?

How much does OpenSL differ to OpenAL?

Thanks!

Was it helpful?

Solution

There's a native audio example included in the samples/ directory of recent ndk releases.

It claims to use OpenSL ES

OTHER TIPS

OpenSL and OpenAL differ quick a bit in terms of interfaces. However, they do have a very similar pattern and the use case is similar too. One this to be aware of is that in the current implementation OpenSL suffers from the same latency issues the java audio apis have.

When using OpenSL you don't have to call any Java code. The latest NDK has support for a native asset manager so no more going through JNI to pass byte arrays around :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top