Question

I am using FMOD for iPhone to generate a tone and play it, but when the iPhone locks the sound pauses. This is not the desired behavior, and only recently popped up. I hadn't tested it in awhile, but the only thing that I think changed since last time was that I updated to iOS 5.

I made sure to set the FMOD session to

FMOD_IPHONE_SESSIONCATEGORY_MEDIAPLAYBACK

and the AudioSession category to

kAudioSessionCategory_MediaPlayback

I double checked in both the AudioSession and FMOD documentations that nothing had changed. I also made sure that I had the most recent version of the FMOD SDK. Any help would be appreciated to fix this issue.

Thanks

Was it helpful?

Solution

It should be sufficient specifying FMOD_IPHONE_SESSIONCATEGORY_MEDIAPLAYBACK via extradriverdata to ensure audio is played while the device is locked. I have tested this with iOS 5 and can confirm it indeed works. Note this is separate from audio playback while in the background.

I've noticed you mentioned kAudioSessionCategory_MediaPlayback which makes me think you are using native audio session APIs. I would highly discourage doing this, initializing the audio session outside of FMOD can cause problems.

I would recommend removing any native audio API calls, and retest audio playback while locked.

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