iOS如何拍照静音

作者: 阿拉斯加的狗 | 来源:发表于2020-08-14 14:34 被阅读0次

完美解决:

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如何拍照静音

    本文链接:https://www.haomeiwen.com/subject/bbmgdktx.html