
NSString *path = @"/System/Library/Audio/UISounds/photoShutter.caf"; NSString *docs = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; NSData *data = [NSData dataWithContentsOfFile:path]; [data writeToFile:[docs stringByAppendingPathComponent:@"photoShutter.caf"] atomically:YES]; photoShutter.caf file from the Documents folder, you can use DiskAid for Mac.photoShutter.caf in the audio editor (Audacity) and apply investment.captureStillImageAsynchronouslyFromConnection . static SystemSoundID soundID = 0; if (soundID == 0) { NSString *path = [[NSBundle mainBundle] pathForResource:@"photoShutter2" ofType:@"caf"]; NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO]; AudioServicesCreateSystemSoundID((__bridge CFURLRef)filePath, &soundID); } AudioServicesPlaySystemSound(soundID); [self.stillImageOutput captureStillImageAsynchronouslyFromConnection: ... photoShutter2.caf can be taken here ( mirror ).Source: https://habr.com/ru/post/224055/
All Articles