|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
UltrasoundListener
This class is a thread that continuously listens for ultrasound through the microphone and notifies the UltrasoundUpdateListener it was instantiated with whenever ultrasound is detected. Any class that instantiates an UltrasoundListener must provide it with an object that implements the UltrasoundUpdateListener interface so that the UltrasoundListener class can properly notify the appropriate class of ultrasound updates.
Field Summary | |
protected UltrasoundAnalyzer[] |
analyzerPool
|
protected int |
analyzerPoolInd
|
protected int |
CHANNELS
|
protected boolean |
debug
|
protected int |
negCount
|
protected int |
posCount
|
protected javax.sound.sampled.TargetDataLine |
targetDataLine
|
protected long[] |
timesDetected
|
protected UltrasoundUpdateListener |
updateListener
|
protected boolean |
usDebounced
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Fields inherited from interface Constants |
AVG_DETECT_TIME, BIGEND, DEBOUNCE_VAL, GROUPADDR, HISTORY_SIZE, MAX_DETECT_TIME, MAXMSGSIZE, N, NUMTHREADS, PORTNUM, ROOM_MSG_BUF, SAMPLE_SIZE, SAMPLING_RATE, SEQUENCE, SIGN, TARGET_FREQUENCY, WEIGHT |
Constructor Summary | |
UltrasoundListener(UltrasoundUpdateListener outsideUpdateListener)
This default constructor assumes a sampling rate of 44100 Hz, a target frequency of 21000 Hz, an N value of 420, and debugging information turned off. |
|
UltrasoundListener(UltrasoundUpdateListener outsideUpdateListener,
boolean inDebug)
|
Method Summary | |
void |
analysisDone(boolean usDetected,
long timeDone)
Provides a means by which UltrasoundAnalyzer threads can notify this UltrasoundListener class when a block of samples is done being analyzed. |
void |
run()
This is the main processing method of this class, where sound is recorded and the samples obtained are analyzed. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected UltrasoundUpdateListener updateListener
protected javax.sound.sampled.TargetDataLine targetDataLine
protected UltrasoundAnalyzer[] analyzerPool
protected int analyzerPoolInd
protected boolean usDebounced
protected int posCount
protected int negCount
protected boolean debug
protected long[] timesDetected
protected int CHANNELS
Constructor Detail |
public UltrasoundListener(UltrasoundUpdateListener outsideUpdateListener)
outsideUpdateListener
- Reference to the object that
implements the
UltrasoundUpdateListener
interface.public UltrasoundListener(UltrasoundUpdateListener outsideUpdateListener, boolean inDebug)
Method Detail |
public void run()
run
in interface java.lang.Runnable
public void analysisDone(boolean usDetected, long timeDone)
usDetected
- Whether or not ultrasound was detected in
the samples.timeDone
- The time at which analysis of the samples
was completed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |