Advertisement
developer

AVAudioSessionCategoryAmbient

Sep 21st, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Allows Playback of Sounds in app without pausing iPod music playback
  2. // http://is.gd/YmQ65Q
  3. // This category allows audio from the iPod, Safari, and other built-in applications to
  4. // play while your application is playing audio.
  5.  
  6.     AVAudioSession *session =[AVAudioSession sharedInstance];
  7.     float version = [[[UIDevice currentDevice] systemVersion] floatValue];
  8.     if (version <6.0) {
  9.         [session setCategory:AVAudioSessionCategoryAmbient error:nil];
  10.     }
  11.     else {
  12.         [session setCategory: AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error: nil];
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement