0

I am using the AVCam by apple and I am having difficulty running AVAudioPlayer while AVCam is running. What shouLd I do? One of them stops every time I run them at the same time. AVCam is running using dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{}); while AVAudioPlayer is in the main queue. Please help me! I need a help!

1 Answers1

1

Import the following

#import <AVFoundation/AVAudioSession.h>

Use following line of code in AppDelegate's didFinishLaunchingwithOptions

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
Vaibhav Jhaveri
  • 1,579
  • 3
  • 28
  • 53