它不断给我错误:
错误域= AVFoundationErrorDomain代码= -11814"无法记录"
我不确定是什么问题?我想在拍摄照片后计数器达到1时正确录制声音.
static int counter;
//counter will always be zero it think unless it is assigned.
if (counter == 0){
dispatch_async([self sessionQueue], ^{
// Update the orientation on the still image output video connection before capturing.
[[[self stillImageOutput] connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:[[(AVCaptureVideoPreviewLayer *)[[self previewView] layer] connection] videoOrientation]];
// Flash set to Auto for Still Capture
[AVCamViewController setFlashMode:AVCaptureFlashModeAuto forDevice:[[self videoDeviceInput] device]];
// Capture a still image.
[[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:[[self stillImageOutput] connectionWithMediaType:AVMediaTypeVideo] completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) {
if (imageDataSampleBuffer)
{//[AVCaptureSession snapStillImage]; …Run Code Online (Sandbox Code Playgroud) afnetworking ×1
avfoundation ×1
clang ×1
cocoapods ×1
ios ×1
ld ×1
objective-c ×1
record ×1
xcode ×1