Interface AudioTrack

    • Method Detail

      • getIdentifier

        java.lang.String getIdentifier()
        Returns:
        The identifier of the track
      • getState

        AudioTrackState getState()
        Returns:
        The current execution state of the track
      • stop

        void stop()
        Stop the track if it is currently playing
      • isSeekable

        boolean isSeekable()
        Returns:
        True if the track is seekable.
      • getPosition

        long getPosition()
        Returns:
        Get the current position of the track in milliseconds
      • setPosition

        void setPosition​(long position)
        Seek to the specified position.
        Parameters:
        position - New position of the track in milliseconds
      • setMarker

        void setMarker​(TrackMarker marker)
        Set the track position marker. This will clear all existing markers.
        Parameters:
        marker - Track position marker to place
      • addMarker

        void addMarker​(TrackMarker marker)
        Adds a marker to the track. Markers can be used to execute code when the track reaches a certain position.
        Parameters:
        marker - The marker to add.
      • removeMarker

        void removeMarker​(TrackMarker marker)
        Removes a marker from the track.
        Parameters:
        marker - The marker to remove.
      • getDuration

        long getDuration()
        Returns:
        Duration of the track in milliseconds
      • makeClone

        AudioTrack makeClone()
        Returns:
        Clone of this track which does not share the execution state of this track
      • getSourceManager

        AudioSourceManager getSourceManager()
        Returns:
        The source manager which created this track. Null if not created by a source manager directly.
      • setUserData

        void setUserData​(java.lang.Object userData)
        Attach an object with this track which can later be retrieved with getUserData(). Useful for retrieving application-specific object from the track in callbacks.
        Parameters:
        userData - Object to store.
      • getUserData

        java.lang.Object getUserData()
        Returns:
        Object previously stored with setUserData(Object)
      • getUserData

        <T> T getUserData​(java.lang.Class<T> klass)
        Parameters:
        klass - The expected class of the user data (or a superclass of it).
        Returns:
        Object previously stored with setUserData(Object) if it is of the specified type. If it is set, but with a different type, null is returned.