0

I'm using a custom camera application , i want the camera to enable the shutter sound if it was on on the device and turn it off otherwise , so is there a default method which will check that , or can i get the settings information of the camera to find that .

I tried this code , but it sounds that is check on the device sound.

    AudioManager audioService = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

    if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
        Toast.makeText(MainActivity.this, "Normal", Toast.LENGTH_SHORT)
                .show();
    }
Reham
  • 1,916
  • 6
  • 21
  • 45

1 Answers1

0
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(id, info);
if (info.canDisableShutterSound) {
    mCamera.enableShutterSound(false)
}

How to mute camera shutter sound on android phone

Community
  • 1
  • 1
Ravindra Shekhawat
  • 4,275
  • 1
  • 19
  • 26
  • thank you but how can i get the id of the camera , and this method will return if i can turn it on or off ,, but how to know if it is on or off? – Reham Apr 16 '14 at 07:32