I am trying to capture an image during a live preview from the camera, by AVFoundation captureStillImageAsynchronouslyFromConnection. So far the program works as expected. However, how can I mute the shutter sound. Thanks!
|
I used this code once to capture iOS default shutter sound (here is list of sound file names https://github.com/TUNER88/iOSSystemSoundsLibrary):
Then I used third-party app to extract Then I saved this sound as
And this really works! I runs test several times, every time I hear no shutter sound :) You can get already inverted sound, captured on iPhone 5S iOS 7.1.1 from this link: https://www.dropbox.com/s/1echsi6ivbb85bv/photoShutter2.caf |
|||||||||||||||||||||
|
Method 1: Not sure if this will work, but try playing a blank audio file right before you send the capture event. To play a clip, add the
Here is a blank audio file if you need it. http://cl.ly/3cKi __________________________________________________________________________________ Method 2:There's also an alternative if this doesn't work. As long as you don't need to have a good resolution, you can grab a frame from the video stream, thus avoiding the picture sound altogether. __________________________________________________________________________________ Method 3: Another way to do this would be to take a "screenshot" of your application. Do it this way:
If you're wanting this to fill the whole screen with a preview of the video stream so that your screenshot looks good:
|
|||||||||||||
|
I live in in Japan, so I can not mute the audio when we take photos for security reason. In video, however audio turns off. I don't understand why. The only way I take a photo without shutter sound is using AVCaptureVideoDataOutput or AVCaptureMovieFileOutput. For analyze still image AVCaptureVideoDataOutput is only way. In AVFoundatation sample code,
In my 3GS it is very heavy when I set CMTimeMake(1, 1); // One frame per second. In WWDC 2010 Sample code, FindMyiCone, I found following code,
When this API is used, the timing is not granted, but API is called sequentially. I this it is best solutions. |
|||
|
A common trick in such cases is to find out if the framework invokes a certain method for this event, and then to overwrite that method temporarily, thereby voiding its effect. I'm sorry but I am not a good enough hack to tell you right away if that works in this case. You could try the "nm" command on the framework executables to see if there's a named function that has a suitatable name, or use gdb with the Simulator to trace where it goes. Once you know what to overwrite, there are those low level ObjC dispatching functions that you can use to redirect the lookup for functions, I believe. I think I've done that once a while ago, but can't remember the details. Hopefully, you can use my hints to google a few solutions paths to this. Good luck. |
|||
|
The only possible work-around I can think of would be to mute the iphone sound when they press the "take picture" button, and then un-mute it a second later. |
|||||||||
|