I’m using OpenSL ES on Android via JNI to play sounds.
I use an asset and a source for each sound, but I can’t destroy them. The destroy method works on the source, but not on asset. In this way the engine stores objects and I reach the limit of 30 sounds very soon simply using the app.
The destroy method is called in a callback on the buffer queue as the decode is done. Calling the destroy method on the player object, my app is in Application Not Responding state.
Which is the best way to create and destroy sound sources?