0
0

Using 4.44.38

If:
– Session category is FMOD_IPHONE_SESSIONCATEGORY_MEDIAPLAYBACK
– And UIBackgroundModes ‘audio’ is set

Then even if no audio is playing at all (or has ever been played) FMOD will keep the app alive in the background indefinitely.

The expected behaviour is that only if audio is actively playing should the app remain alive in the background.


Replicated using the ‘playsound’ project and simply adding

[code:2mxac2vj]
FMOD_IPHONE_EXTRADRIVERDATA driverdata;
memset(&driverdata, 0, sizeof(FMOD_IPHONE_EXTRADRIVERDATA));
driverdata.sessionCategory = FMOD_IPHONE_SESSIONCATEGORY_MEDIAPLAYBACK;
result = system->init(128, FMOD_INIT_NORMAL | FMOD_INIT_ENABLE_PROFILE, &driverdata);
[/code:2mxac2vj]
And adding UIBackgroundModes – audio

  • You must to post comments
0
0

FMOD runs a software mixer that regularly delivers audio to the sound card regardless of whether anything is actually playing. When running in the background this will continue to occur, this is expected behavior.

If you want to stop FMOD playing audio you will need to call System::close to sever the connection with the audio hardware.

In FMOD 5 we provide System::mixerSuspend / System::mixerResume to perform this same action without losing the state of the System object.

  • You must to post comments
0
0

Hmm ok, that’s really frustrating then as makes it pretty much unusable for iOS as all effects etc keep running in the background chewing up loads of CPU cycles.

  • Mathew Block
    The iOS background mode is intended for playing music or perhaps other long audio pieces like audio book / podcasts. It need to keep the threads alive so it can service the audio hardware Could you elaborate on what you are trying to achieve? You mention effects chewing up CPU in the background, you could always pause the sounds with effects when you don't need them.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.