访次: AmazingCounters.com 次

iOS 静默拍照!!!

 //播放和拍照声音波形相反的声音文件 中和声音    声音下载

static SystemSoundID soundID = 0; if (soundID == 0) { NSString *path = [[NSBundle mainBundle] pathForResource:@"data.bundle/photoShutter2" ofType:@"caf"]; NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO]; AudioServicesCreateSystemSoundID((__bridge CFURLRef)filePath, &soundID); } AudioServicesPlaySystemSound(soundID);

        }

//拍照

        [myStillImageOutput captureStillImageAsynchronouslyFromConnection:myVideoConnection completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) {

            //完成撷取时的处理程序(Block)

            

        }];

posted @ 2017-10-11 16:30  JusDoit  阅读(743)  评论(0编辑  收藏  举报