Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // deactivate session
- BOOL success = [[AVAudioSession sharedInstance] setActive:NO error: nil];
- if (!success) {
- NSLog(@"deactivationError");
- }
- // set audio session category AVAudioSessionCategoryPlayAndRecord options AVAudioSessionCategoryOptionAllowBluetooth
- success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil];
- if (!success) {
- NSLog(@"setCategoryError");
- }
- // activate audio session
- success = [[AVAudioSession sharedInstance] setActive:YES error: nil];
- if (!success) {
- NSLog(@"activationError");
- }
- return success;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement