Sdílet prostřednictvím


Camera.EnableShutterSound(Boolean) Method

Definition

Caution

deprecated

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

[Android.Runtime.Register("enableShutterSound", "(Z)Z", "")]
[System.Obsolete("deprecated")]
public bool EnableShutterSound (bool enabled);
[<Android.Runtime.Register("enableShutterSound", "(Z)Z", "")>]
[<System.Obsolete("deprecated")>]
member this.EnableShutterSound : bool -> bool

Parameters

enabled
Boolean

whether the camera should play the system shutter sound when #takePicture takePicture is called.

Returns

true if the shutter sound state was successfully changed. false if the shutter sound state could not be changed. true is also returned if shutter sound playback is already set to the requested state.

Attributes

Remarks

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.

Java documentation for android.hardware.Camera.enableShutterSound(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • <xref:Android.Hardware.Camera.TakePicture(.IShutterCallback%2c+.IPictureCallback%2c+.IPictureCallback)>