Class AudioAnalyzer

    • Constructor Detail

      • AudioAnalyzer

        public AudioAnalyzer()
    • Method Detail

      • cancel

        public void cancel()
        Description copied from interface: Operation
        Cancels the operation asynchronously.
        Specified by:
        cancel in interface Operation
      • canBeCancelled

        public boolean canBeCancelled()
        Description copied from interface: Operation
        Indicates whether this operation can be cancelled.
        Specified by:
        canBeCancelled in interface Operation
        Returns:
        true or false
      • isCancelled

        public boolean isCancelled()
        Description copied from interface: Operation
        Indicates whether this operation has been cancelled.
        Specified by:
        isCancelled in interface Operation
        Returns:
        true or false
      • getRequiredClip

        public AudioClip getRequiredClip​(AudioFileFormat format)
        Returns the AudioClip that is actually required to perform the analysis.
        Parameters:
        format - file format of the original, potentially compressed audio file
        Returns:
        clip actually required for analysis or null, if the whole file is needed or the clip cannot be determined. The default implementation always returns null.
      • getRequiredClip

        protected AudioClip getRequiredClip​(AudioFileFormat audioFileFormat,
                                            int filesizeFraction,
                                            long durationInMS)
        Utility method that should be used to override getRequiredClip(javax.sound.sampled.AudioFileFormat).
        Parameters:
        filesizeFraction - reciprocal value of the fraction we want to jump to (start point), if less than or equal to one, the startoffset of the resulting audioclip will be 0
        audioFileFormat - file format of the original, potentially compressed audio file
        durationInMS - duration of the desired clip in ms (length)
        Returns:
        clip actually required for analysis or null, if the duration of the file was indeterminable