Max
Max

Reputation: 2749

iOS 7 Background Audio

I'm trying to play audio in background on iOS 7. While everything worked nicely in iOS 6 it stopped to work now. If I put my app into background my audio keeps playing but as soon as I start another Audio-app like a synth app, my app can't do anything any longer (no audio / timers stopped etc.)

I'm using this code to set the audio session:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];

What can I do to be still able to play audio / send midi events even if another music/audio app is in the foreground?

For playing audio effects I use FMOD.

Upvotes: 0

Views: 892

Answers (1)

Tommy Nicholas
Tommy Nicholas

Reputation: 1173

I think you want

[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error: nil];
[[AVAudioSession sharedInstance] setActive: YES error: nil];

:AVAudioSessionCategoryOptionMixWithOthers I think does what you want, although it's not entirely clear. Let me know if that works!

Upvotes: 0

Related Questions