Class CaptureHelperThread

  • All Implemented Interfaces:
    java.lang.Runnable

    public class CaptureHelperThread
    extends java.lang.Thread
    Helper thread to read (capture) continuously from line. Capture data is discarded.
    Author:
    klausj
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      CaptureHelperThread​(javax.sound.sampled.AudioInputStream audioInputStream, int bufferSize)
      Create helper capture thread
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close this capture helper thread.
      javax.sound.sampled.AudioInputStream getAudioInputStream()
      Get audio input stream
      void run()  
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
    • Constructor Detail

      • CaptureHelperThread

        public CaptureHelperThread​(javax.sound.sampled.AudioInputStream audioInputStream,
                                   int bufferSize)
        Create helper capture thread
        Parameters:
        audioInputStream - audio input stream to read from
        bufferSize - buffer size for dummy buffer
    • Method Detail

      • getAudioInputStream

        public javax.sound.sampled.AudioInputStream getAudioInputStream()
        Get audio input stream
        Returns:
        audio input stream
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • close

        public void close()
        Close this capture helper thread. Stops reading from audio stream, and blocks until thread is joined (finished).