Video Recording using AVFoundation

前端 未结 1 1744
故里飘歌
故里飘歌 2020-12-31 17:53

I am trying to record video using AVFoundation. When I add video input only to the session, everything works fine but when I add an audio input to it, it stops recording the

相关标签:
1条回答
  • 2020-12-31 18:18

    I have figured it out. I needed category mixing. Following is the code that made it:

    NSError *setCategoryError = nil;
    [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error: &setCategoryError]; 
    
    if (setCategoryError) { NSLog(@"%@",[setCategoryError description]); }
    
     OSStatus propertySetError = 0;
     UInt32 allowMixing = true;
    
     propertySetError = AudioSessionSetProperty ( kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof (allowMixing), &allowMixing);
    
    0 讨论(0)
提交回复
热议问题