iOS技术交流收藏

iOS如何拍照静音

2020-08-14  本文已影响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,有可能被拒
上一篇下一篇

猜你喜欢

热点阅读