IT. Expert System.

Android Reference

MediaSyncEvent


android.media

Class MediaSyncEvent



  • public class MediaSyncEvent
    extends Object
    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.

    • Field Detail

      • SYNC_EVENT_NONE

        public static final int SYNC_EVENT_NONE
        No sync event specified. When used with a synchronized playback or capture method, the behavior is equivalent to calling the corresponding non synchronized method.
        See Also:
        Constant Field Values
      • SYNC_EVENT_PRESENTATION_COMPLETE

        public static final 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. A synchronization of this type requires a source audio session ID to be set via {@link #setAudioSessionId(int) method.
        See Also:
        Constant Field Values
    • Method Detail

      • createEvent

        public static MediaSyncEvent createEvent(int eventType)
                                          throws IllegalArgumentException
        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.

        Parameters:
        eventType - the synchronization event type.
        Returns:
        the MediaSyncEvent created.
        Throws:
        IllegalArgumentException
      • setAudioSessionId

        public MediaSyncEvent setAudioSessionId(int audioSessionId)
                                         throws IllegalArgumentException
        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 MediaPlayer.getAudioSessionId() when monitoring an event on a particular MediaPlayer.

        Parameters:
        audioSessionId - the audio session ID of the event source being monitored.
        Returns:
        the MediaSyncEvent the method is called on.
        Throws:
        IllegalArgumentException
      • getType

        public int getType()
        Gets the synchronization event type.
        Returns:
        the synchronization event type.
      • getAudioSessionId

        public int getAudioSessionId()
        Gets the synchronization event audio session ID.
        Returns:
        the synchronization audio session ID. The returned audio session ID is 0 if it has not been set.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 157 / 158697666. Delta: 0.02258 с