Reputation: 1
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!
Upvotes: 0
Views: 85
Reputation: 1605
Import the following
#import <AVFoundation/AVAudioSession.h>
Use following line of code in AppDelegate's didFinishLaunchingwithOptions
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
Upvotes: 1