StackoverflowのHabrahabr k06a (Anton Bukov)のユーザーは、すべてのプラットフォームで動作する普遍的な方法を提案しました。 彼は、アクティブノイズリダクションを使用すること、つまり、サウンドを反転し、オリジナルの直前に反転コピーを開始することを提案しています。 絶対に静かな写真が撮れます!
k06aはiOSの例を説明しています。
1.システムのシャッター音を録音します。 サウンドがファイルシステムに存在するパスは、 iOSSystemSoundsLibraryコードで見つけることができます。
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];
2. Documentsフォルダーから
photoShutter.caf
ファイル
photoShutter.caf
ます。DiskAidfor Macを使用できます。
3.サウンドエディター(Audacity)で
photoShutter.caf
を開き、インベントリを適用します。
4.結果のサウンドをiOSに保存し、
captureStillImageAsynchronouslyFromConnection
直前に
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
をここで撮影できます ( ミラー )。