ofSoundPlayer - playing while app is in the background


I have an iOS app that plays sounds using ofSoundPlayer (i.e. AVSoundPlayer). It works well.

My app is configured to run in the background and I want to play a sound while I’m in the background.

Even after reading dozens of reference pages and posts, I couldn’t achieve this.

Audio is still being heard if the app started the playing while the app was in the foreground.

BUT, if I play a sound (plane ol’ ofSoundPlayer.play) while already in the background, it doesn’t play. I debugged inside and saw that indeed I’m getting to [AVSoundPlayer play] call, but it’s just being ignored.

I already tried:

  1. setting background modes in info.plist
  2. setting session category to playback

but nothing seems to work.

It’s not an OF thing, but I’m writing this because perhaps someone ran into this issue and knows what to do with it?

Thanks in advance,