0

I have a lot of sounds to play but not this default sound, I don't know where this sound come from ?

 private final ShutterCallback mShutterCallback = new ShutterCallback();    
//when i take it
        mCameraDevice.takePicture(mShutterCallback, mRawPictureCallback,
                    mPostViewPictureCallback, new JpegPictureCallback(loc));    

    private final class ShutterCallback implements
            android.hardware.Camera.ShutterCallback {
        public void onShutter() {
            mShutterCallbackTime = System.currentTimeMillis();
            mShutterLag = mShutterCallbackTime - mCaptureStartTime;
            Log.v(TAG, "mShutterLag = " + mShutterLag + "ms");
            clearFocusState();
        }
    }    
duggu
  • 37,851
  • 12
  • 116
  • 113
  • 1
    possible duplicate of [android mute camera shutter sound?](http://stackoverflow.com/questions/14476791/android-mute-camera-shutter-sound) – Matt Gibson Jan 20 '15 at 09:41
  • 1
    Bear in mind that this may be [illegal in some countries](https://www.google.com/search?client=safari&rls=en&q=japan+shutter+sound+law&ie=UTF-8&oe=UTF-8). – Matt Gibson Jan 20 '15 at 09:42

1 Answers1

0

Use Below code before getting the button clicked

 AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
    mgr.setStreamMute(AudioManager.STREAM_SYSTEM, true);

And these two lines just after the image get captured:

AudioManager mgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
mgr.setStreamMute(AudioManager.STREAM_SYSTEM, false);
Anchit Mittal
  • 3,412
  • 4
  • 28
  • 48