Class AudioClip


  • public class AudioClip
    extends Object
    Audio clip represents a part of an actual audio track. It's immutable by design.
    Author:
    Hendrik Schreiber
    • Field Detail

      • UNDEFINED_CLIP

        public static final AudioClip UNDEFINED_CLIP
      • EMPTY_CLIP

        public static final AudioClip EMPTY_CLIP
    • Constructor Detail

      • AudioClip

        public AudioClip​(int startTime,
                         int stopTime)
        Constructor for immutable instance.
        Parameters:
        startTime - start time in ms
        stopTime - stop time in ms
      • AudioClip

        public AudioClip​(int startTime,
                         int stopTime,
                         int totalTime)
        Constructor for immutable instance.
        Parameters:
        startTime - start time in ms
        stopTime - stop time in ms
    • Method Detail

      • merge

        public AudioClip merge​(AudioClip that)
        Creates a third AudioClip that contains both this AudioClip and the given AudioClip. The new AudioClip may also contain data from sections between the two AudioClips. So strictly speaking it is not a union.
        Parameters:
        that - AudioClip to merge with
        Returns:
        merged AudioClip
      • getTotalTime

        public int getTotalTime()
        Returns:
        the total duration of the original audiosource that this is a clip of
      • getStartTime

        public int getStartTime()
        Returns:
        Start time in ms.
      • getStopTime

        public int getStopTime()
        Returns:
        Stop time in ms.
      • isEmpty

        public boolean isEmpty()
        Indicates whether this is a zero length clip.
        Returns:
        true or false
      • isUndefined

        public boolean isUndefined()
        Returns:
        true, if the clip is undefined, meaning the whole source is meant