Android.Media.MediaActionSound.Play Method

Syntax

[Android.Runtime.Register("play", "(I)V", "GetPlay_IHandler")]
public virtual void Play ([Android.Runtime.GeneratedEnum] MediaActionSoundType soundName)

See Also

Android.Hardware.Camera.TakePicture(.IShutterCallback, .IPictureCallback, .IPictureCallback)
MediaRecorder
MediaActionSound.ShutterClick
MediaActionSound.FocusComplete
MediaActionSound.StartVideoRecording
MediaActionSound.StopVideoRecording

Parameters

soundName
The type of sound to play, selected from SHUTTER_CLICK, FOCUS_COMPLETE, START_VIDEO_RECORDING, or STOP_VIDEO_RECORDING.

Remarks

Play one of the predefined platform sounds for media actions.

Use this method to play a platform-specific sound for various media actions. The sound playback is done asynchronously, with the same behavior and content as the sounds played by Android.Hardware.Camera.TakePicture(.IShutterCallback, .IPictureCallback, .IPictureCallback), MediaRecorder.Start, and MediaRecorder.Stop.

With the Android.Hardware.Camera2 API, this method can be used to play standard camera operation sounds with the appropriate system behavior for such sounds.

With the older Android.Hardware.Camera API, using this method makes it easy to match the default device sounds when recording or capturing data through the preview callbacks, or when implementing custom camera-like features in your application.

If the sound has not been loaded by MediaActionSound.Load(MediaActionSoundType) before calling play, play will load the sound at the cost of some additional latency before sound playback begins.

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 16