|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--ocvolume.audio.micInput
description: continuous record voice from microphone, with at least 600ms pause in between words
or discrete recording with at least 100ms in the front and end being silent
default is continuous recording
calls: none
called by: volume
input: digitalize speech signal
output: speech signal stored in array
Field Summary | |
protected static javax.sound.sampled.AudioFormat |
format
audio format |
protected static boolean |
SAMPLE_BIG_ENDIAN
use little-endian 00000100 00000001 first byte 00000001 second byte 00000100 |
protected static int |
SAMPLE_BITS
sample size - 16 bits |
protected static int |
SAMPLE_BUFFER_SIZE
buffersize 2 seconds |
protected static int |
SAMPLE_CHANNELS
sample channels |
protected static javax.sound.sampled.AudioFormat.Encoding |
SAMPLE_ENCODING
encoding method "pulse-code modulation" predefined encoding |
protected static float |
SAMPLE_FRAME_RATE
sample frame rate |
protected static int |
SAMPLE_FRAME_SIZE
sample frame size |
protected static float |
SAMPLE_RATE
capture amound of sample per second, can be changed in the constructor 16 kHz |
protected java.util.Vector |
vBufferWord
word buffer |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
micInput()
Constructor |
Method Summary | |
boolean |
byteArrayComplete()
return true if a word is stored in the buffer calls: none called by: volume |
void |
newWord()
read the next element in the word buffer calls: none called by: volume |
void |
removeOldWord()
remove the first element in the word buffer calls: none called by: volume |
short |
returnShort(int IndexNum)
return the signed short with given index calls: none called by: volume |
short[] |
returnShortArray()
return the signed short array calls: none called by: volume |
int |
returnShortSize()
return the length of the array of the short array calls: none called by: volume |
void |
run()
recording from the microphone calls: none called by: volume |
void |
setContinuous()
set the recording method to continuous calls: none called by: volume |
void |
setDiscrete()
set the recording method to discrete calls: none called by: volume |
void |
stopRecord()
Stop the mic input calls: none called by: volume |
int |
wordBufferSize()
return how many words are in the buffer calls: none called by: volume |
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 static final javax.sound.sampled.AudioFormat.Encoding SAMPLE_ENCODING
protected static final float SAMPLE_RATE
protected static final int SAMPLE_BITS
protected static final int SAMPLE_CHANNELS
protected static final float SAMPLE_FRAME_RATE
protected static final int SAMPLE_FRAME_SIZE
protected static final boolean SAMPLE_BIG_ENDIAN
protected static final int SAMPLE_BUFFER_SIZE
protected static final javax.sound.sampled.AudioFormat format
protected java.util.Vector vBufferWord
Constructor Detail |
public micInput()
Method Detail |
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void stopRecord()
public int wordBufferSize()
public boolean byteArrayComplete()
public void newWord()
public void removeOldWord()
public void setContinuous()
public void setDiscrete()
public int returnShortSize()
public short returnShort(int IndexNum)
IndexNum
- index number
public short[] returnShortArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |