Android, fmod core, fmod.jar, AudioDevice.close called twice

I’m using fmod core (not studio) from C++ (JNI) on Android and I’ve noticed that AudioDevice.close (from fmod.jar) is called from FMOD::System::mixerSuspend and from FMOD::System::release.
In my case, when the activity goes into pause I dispatch a call to mixerSuspend and when it’s destroyed I’m dispatching a call to release. This makes that when leaving the activity for good, AudioDevice.close is called twice (from from onPause->…->mixerSuspend and then from onDestroy->…->release) and it seems that the close function is not designed for this particular case (on the second call mTrack is null and I get a crash :)).
I wonder if anyone has any advice’s on how I can better deal with this situation.
I still want to to stop the sound processing when the application is paused into background and resume it when the application returns.

Jean-Arthur Deda.

MixerResume should also be called from OnDestroy, as it is possible to transition from OnStop directly to OnDestroy. If the system is not suspended then MixerResume will not have any effect.

We will also add more on this to our docs to clarify this in the future.

1 Like