java.lang.Object | |
↳ | android.media.MediaSyncEvent |
The MediaSyncEvent class defines events that can be used to synchronize playback or capture actions between different players and recorders.
For instance, 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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | SYNC_EVENT_NONE | No sync event specified. | |||||||||
int | SYNC_EVENT_PRESENTATION_COMPLETE | 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 Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a synchronization event of the sepcified type.
| |||||||||||
Gets the synchronization event audio session ID.
| |||||||||||
Gets the synchronization event type.
| |||||||||||
Sets the event source audio session ID.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
No sync event specified. When used with a synchronized playback or capture method, the behavior is equivalent to calling the corresponding non synchronized method.
The corresponding action is triggered only when the presentation is completed (meaning the media has been presented to the user) on the specified session. A synchronization of this type requires a source audio session ID to be set via {@link #setAudioSessionId(int) method.
Creates a synchronization event of the sepcified type.
The type specifies which kind of event is monitored.
For instance, event SYNC_EVENT_PRESENTATION_COMPLETE
corresponds to the audio being
presented to the user on a particular audio session.
eventType | the synchronization event type. |
---|
IllegalArgumentException |
---|
Gets the synchronization event audio session ID.
Gets the synchronization event type.
Sets the event source audio session ID.
The audio session ID specifies on which audio session the synchronization event should be
monitored.
It is mandatory for certain event types (e.g. SYNC_EVENT_PRESENTATION_COMPLETE
).
For instance, the audio session ID can be retrieved via
getAudioSessionId()
when monitoring an event on a particular MediaPlayer.
audioSessionId | the audio session ID of the event source being monitored. |
---|
IllegalArgumentException |
---|