enableShutterSound method

Future<bool> enableShutterSound({
  1. required bool enabled,
})

Enable or disable the default shutter sound when taking a picture.

By default, the camera plays the system-defined camera shutter sound when takePicture is called. Using this method, the shutter sound can be disabled. It is strongly recommended that an alternative shutter sound is played in the ShutterCallback when the system shutter sound is disabled.

Note that devices may not always allow disabling the camera shutter sound. If the shutter sound state cannot be set to the desired value, this method will return false. CameraInfo.canDisableShutterSound can be used to determine whether the device will allow the shutter sound to be disabled.

If the call fails; usually this would be because of a hardware or other low-level error, or because release has been called on this Camera instance.

This is only supported on Android versions >= Build.VERSION_CODES.JELLY_BEAN_MR1. A PlatformException will be thrown if the android version is below this.

Implementation

Future<bool> enableShutterSound({required bool enabled}) async {
  return await _channel.$enableShutterSound(this, enabled) as bool;
}