Hi,
I'm having some problems with OpenSL ES. My game is based in the native-activity sample and also uses OpenSL ES to stream ogg/vorbis and play uncompressed PCM data.
As it doesn't seem to be possible to reuse the AudioPlayer object and setup a new sound source to play different sound effects, I'm calling to CreateAudioPlayer() each time I want to play a new sound effect.
Then when my callback for that sound effect gets called I call to the Destroy() method
(* mBqPlayerObject)->Destroy( mBqPlayerObject );
There is never more than one sound effect playing at the same time.
Eventually after playing a few sound effects the game fails while trying to create a new AudioPlayer, the call that fails is the one below:
result = (* mBqPlayerObject)->Realize( mBqPlayerObject, SL_BOOLEAN_FALSE );
In logcat I can see the following:
E/AudioFlinger( 190): no more track names available
E/AudioTrack(32581): AudioFlinger could not create track, status: -12
E/libOpenSLES(32581): AudioTrack::initCheck status 4294967284
W/libOpenSLES(32581): Leaving Object::Realize (SL_RESULT_CONTENT_UNSUPPORTED)
I don't understand why the system runs out of tracks because I am destroying the mBqPlayerObject every time I play a sound effect. Isn't that enough to release the tracks?
I'd appreciate any feedback.