Class AudioLoader

  • java.lang.Object


  • public class AudioLoader
    extends javax.swing.SwingWorker<AudioLoader.ReturnObject,java.lang.Void>
    A swing worker that loads an audio file in a separate thread. It returns a RetunObject when the loading is complete.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  AudioLoader.ReturnObject
      An object returned by the AudioLoader.
      • Nested classes/interfaces inherited from class javax.swing.SwingWorker

        javax.swing.SwingWorker.StateValue
    • Constructor Summary

      Constructors 
      Constructor and Description
      AudioLoader(java.io.File audioFile, int minChunkSize, int maxScaleFactor) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected AudioLoader.ReturnObject doInBackground()
      Reads the audio files and build all the min and max for all the shunks of frames
      protected javax.sound.sampled.AudioFormat getConversionFormat() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from class javax.swing.SwingWorker

        addPropertyChangeListener, cancel, done, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
    • Field Detail

      • DEFAULT_CONVERSION_FORMAT

        public static final javax.sound.sampled.AudioFormat DEFAULT_CONVERSION_FORMAT
        The default conversion format used. Also the conversion format returned by getConversionFormat()
      • FILE_LOAD_TOTAL_PROGRESS

        public static final int FILE_LOAD_TOTAL_PROGRESS
        See Also:
        Constant Field Values
    • Constructor Detail

      • AudioLoader

        public AudioLoader(java.io.File audioFile,
                           int minChunkSize,
                           int maxScaleFactor)
    • Method Detail

      • doInBackground

        protected AudioLoader.ReturnObject doInBackground()
                                                   throws java.lang.Exception
        Reads the audio files and build all the min and max for all the shunks of frames
        Specified by:
        doInBackground in class javax.swing.SwingWorker<AudioLoader.ReturnObject,java.lang.Void>
        Throws:
        java.lang.Exception
      • getConversionFormat

        protected javax.sound.sampled.AudioFormat getConversionFormat()