Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. // deactivate session
  2. BOOL success = [[AVAudioSession sharedInstance] setActive:NO error: nil];
  3. if (!success) {
  4. NSLog(@"deactivationError");
  5. }
  6.  
  7. // set audio session category AVAudioSessionCategoryPlayAndRecord options AVAudioSessionCategoryOptionAllowBluetooth
  8. success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil];
  9. if (!success) {
  10. NSLog(@"setCategoryError");
  11. }
  12.  
  13. // activate audio session
  14. success = [[AVAudioSession sharedInstance] setActive:YES error: nil];
  15. if (!success) {
  16. NSLog(@"activationError");
  17. }
  18.  
  19. return success;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement