user2861124
user2861124

Reputation: 1

Play AVAudio Player and AVCam at the same time

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

Answers (1)

Vaibhav Jhaveri
Vaibhav Jhaveri

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

Related Questions