CameraDevice.CameraAudioRestriction Property

Definition

Get currently applied global camera audio restriction mode. -or- Set audio restriction mode when this CameraDevice is being used.

public virtual int CameraAudioRestriction { [Android.Runtime.Register("getCameraAudioRestriction", "()I", "GetGetCameraAudioRestrictionHandler", ApiSince=30)] get; [Android.Runtime.Register("setCameraAudioRestriction", "(I)V", "GetSetCameraAudioRestriction_IHandler", ApiSince=30)] set; }
[<get: Android.Runtime.Register("getCameraAudioRestriction", "()I", "GetGetCameraAudioRestrictionHandler", ApiSince=30)>]
[<set: Android.Runtime.Register("setCameraAudioRestriction", "(I)V", "GetSetCameraAudioRestriction_IHandler", ApiSince=30)>]
member this.CameraAudioRestriction : int with get, set

Property Value

The current system-wide mute mode setting in effect

Attributes

Remarks

Property getter documentation:

Get currently applied global camera audio restriction mode.

Application can use this method to retrieve the system-wide camera audio restriction settings described in #setCameraAudioRestriction.

Java documentation for android.hardware.camera2.CameraDevice.getCameraAudioRestriction().

Property setter documentation:

Set audio restriction mode when this CameraDevice is being used.

Some camera hardware (e.g. devices with optical image stabilization support) are sensitive to device vibration and video recordings can be ruined by unexpected sounds. Applications can use this method to suppress vibration or sounds coming from ringtones, alarms or notifications. Other vibration or sounds (e.g. media playback or accessibility) will not be muted.

The mute mode is a system-wide setting. When multiple CameraDevice objects are setting different modes, the system will pick a the mode that's union of all modes set by CameraDevice. Applications can also use #getCameraAudioRestriction to query current system-wide camera mute mode in effect.

The mute settings from this CameraDevice will be automatically removed when the CameraDevice is closed or the application is disconnected from the camera.

Java documentation for android.hardware.camera2.CameraDevice.setCameraAudioRestriction(int).

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