iOS如何拍照静音

完美解决:

AVCapturePhotoCaptureDelegate
- (void)captureOutput:(AVCapturePhotoOutput *)output didFinishProcessingPhotoSampleBuffer:(CMSampleBufferRef)photoSampleBuffer previewPhotoSampleBuffer:(CMSampleBufferRef)previewPhotoSampleBuffer resolvedSettings:(AVCaptureResolvedPhotoSettings *)resolvedSettings bracketSettings:(AVCaptureBracketedStillImageSettings *)bracketSettings error:(NSError *)error;

- (void)captureOutput:(AVCapturePhotoOutput *)output willCapturePhotoForResolvedSettings:(AVCaptureResolvedPhotoSettings *)resolvedSettings{
   /// 释放声音
   AudioServicesDisposeSystemSoundID(1108);
}


复制代码willCapturePhotoForResolvedSettings 时释放声音
AudioServicesDisposeSystemSoundID(1108);

1108 是非公开的音频ID,有可能被拒

你可能感兴趣的:(iOS如何拍照静音)