bin
Class ThreadedRecorder

java.lang.Object
  extended by bin.ThreadedRecorder
All Implemented Interfaces:
java.lang.Runnable

public class ThreadedRecorder
extends java.lang.Object
implements java.lang.Runnable


Constructor Summary
ThreadedRecorder(AudioCapture source)
          Create a new ThreadedRecorder using an initialized AudioCapture object.
 
Method Summary
 boolean isPaused()
           
 boolean isRecording()
           
static void main(java.lang.String[] args)
           
 void pause()
          (un)pause the recording; on pause, the recording continues, but is not saved to the file.
 void run()
          Internal thread function, takes care of the actual recording
 java.io.OutputStream start(java.lang.String fileName)
          Start the recording and save to the given file.
 void stop()
          Stop the recording
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadedRecorder

public ThreadedRecorder(AudioCapture source)
Create a new ThreadedRecorder using an initialized AudioCapture object. Once start is called, the raw data (matching the AudioCapture format) will be saved to a file.

Parameters:
source -
Method Detail

isPaused

public boolean isPaused()

isRecording

public boolean isRecording()

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

pause

public void pause()
(un)pause the recording; on pause, the recording continues, but is not saved to the file.


run

public void run()
Internal thread function, takes care of the actual recording

Specified by:
run in interface java.lang.Runnable

start

public java.io.OutputStream start(java.lang.String fileName)
                           throws java.io.IOException
Start the recording and save to the given file. File will be overwritten!

Parameters:
fileName - absolute path to target file; if null, a ByteArrayOutputStream is used.
Returns:
the output stream used for this recording; either BufferedOuputStream or ByteArrayOutputStream
Throws:
java.io.IOException

stop

public void stop()
Stop the recording