// Allows Playback of Sounds in app without pausing iPod music playback
// http://is.gd/YmQ65Q
// This category allows audio from the iPod, Safari, and other built-in applications to
// play while your application is playing audio.
AVAudioSession *session =[AVAudioSession sharedInstance];
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version <6.0) {
[session setCategory:AVAudioSessionCategoryAmbient error:nil];
}
else {
[session setCategory: AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error: nil];
}
Comments
0 B
|👍
/👎