Android Guides | Samples

Android.Media.MediaSyncEvent Class

The MediaSyncEvent class defines events that can be used to synchronize playback or capture actions between different players and recorders.

See Also: MediaSyncEvent

Syntax

[Android.Runtime.Register("android/media/MediaSyncEvent", DoNotGenerateAcw=true)]
public class MediaSyncEvent : Object

Remarks

The MediaSyncEvent class defines events that can be used to synchronize playback or capture actions between different players and recorders.

For instance, AudioRecord.StartRecording(MediaSyncEvent) is used to start capture only when the playback on a particular audio session is complete. The audio session ID is retrieved from a player (e.g MediaPlayer, AudioTrack or ToneGenerator) by use of the getAudioSessionId() method.

[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

The members of Android.Media.MediaSyncEvent are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
SyncEventNoneMediaSyncEventType (0). No sync event specified.
const
SyncEventPresentationCompleteMediaSyncEventType (1). The corresponding action is triggered only when the presentation is completed (meaning the media has been presented to the user) on the specified session.

Public Properties

[read-only]
AudioSessionIdInt32. Gets the synchronization event audio session ID.
[read-only]
TypeMediaSyncEventType. Gets the synchronization event type.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

static
CreateEvent(MediaSyncEventType) : MediaSyncEvent
Creates a synchronization event of the sepcified type.
SetAudioSessionId(Int32) : MediaSyncEvent
Sets the event source audio session ID.