I am trying to run AVCaptureSession in a view controller, but at the same time I am also calling a function from a library that uses AVAudioSession. I cannot get much information from the debugger, except that it fires when I call this particular library function. Libpd library:
https://github.com/libpd
and it calls AVAudioSession as sharedInstance. I call libpd like:
[self.audioController configurePlaybackWithSampleRate:44100 numberChannels:2 inputEnabled:YES mixingEnabled:YES]
so mixing is turned on, but just in case, I recompiled it so that when it inserts, I do:
UInt32 doSetProperty = 1; AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(doSetProperty), &doSetProperty);
but no luck. Moving calls in libpd to viewWillAppear in the view controller didn't work either. However, if I take the code that calls libpd from my view manager and put it in the application delegate in the didFinishLaunchingWithOptions file, then it will start just fine, and both sessions seem to coexist without crashing.
Am I missing something in AVCaptureSession and mixing? How do I get along in both sessions together? I do not use AVCapture to capture audio, only the input of the camera, so should I somehow get around both?
pland source share