Main Page | Packages | Class List | File List | Class Members

voce.SpeechRecognizer Class Reference

List of all members.

Public Member Functions

 SpeechRecognizer (String configFilename, String grammarPath, String grammarName)
void run ()
int getQueueSize ()
String popString ()
void setEnabled (boolean e)
boolean isEnabled ()
void destroy ()

Private Attributes

Recognizer mRecognizer = null
Microphone mMicrophone = null
volatile Thread mRecognitionThread = null
boolean mRecognitionThreadRunning = false
LinkedList< String > mRecognizedStringQueue

Detailed Description

Handles all speech recognition (i.e. speech-to-text) functions. Uses a separate thread for recognition. Maintains an internal queue of recognized strings.

Definition at line 42 of file SpeechRecognizer.java.


Constructor & Destructor Documentation

voce.SpeechRecognizer.SpeechRecognizer String  configFilename,
String  grammarPath,
String  grammarName
 

Constructs and initializes the speech recognizer. 'grammarPath' can be a relative or absolute path. 'grammarName' is the name of a grammar within a .gram file in the 'grammarPath' (all .gram files in 'grammarPath' will automatically be searched). If the 'grammarName' is empty, no grammar will be used.

Definition at line 65 of file SpeechRecognizer.java.

References voce.SpeechRecognizer.mMicrophone, voce.SpeechRecognizer.mRecognizedStringQueue, and voce.SpeechRecognizer.mRecognizer.


Member Function Documentation

void voce.SpeechRecognizer.destroy  ) 
 

Deallocates speech recognizer.

Definition at line 232 of file SpeechRecognizer.java.

References voce.SpeechRecognizer.mRecognizer, and voce.SpeechRecognizer.setEnabled().

Referenced by voce.SpeechInterface.destroy().

int voce.SpeechRecognizer.getQueueSize  ) 
 

Returns the number of recognized strings currently in the recognized string queue.

Definition at line 152 of file SpeechRecognizer.java.

References voce.SpeechRecognizer.mRecognizedStringQueue.

Referenced by voce.SpeechInterface.getRecognizerQueueSize(), and voce.SpeechRecognizer.popString().

boolean voce.SpeechRecognizer.isEnabled  ) 
 

Returns true if the recognizer is currently enabled.

Definition at line 226 of file SpeechRecognizer.java.

References voce.SpeechRecognizer.mMicrophone.

Referenced by voce.SpeechInterface.isRecognizerEnabled().

String voce.SpeechRecognizer.popString  ) 
 

Returns and removes the oldest recognized string from the recognized string queue. Returns an empty string if the queue is empty.

Definition at line 160 of file SpeechRecognizer.java.

References voce.SpeechRecognizer.getQueueSize(), and voce.SpeechRecognizer.mRecognizedStringQueue.

Referenced by voce.SpeechInterface.popRecognizedString().

void voce.SpeechRecognizer.run  ) 
 

Contains the main processing to be done by the recognition thread. Called indirectly after 'start' is called.

Definition at line 114 of file SpeechRecognizer.java.

References voce.SpeechRecognizer.mMicrophone, voce.SpeechRecognizer.mRecognitionThread, voce.SpeechRecognizer.mRecognitionThreadRunning, voce.SpeechRecognizer.mRecognizedStringQueue, and voce.SpeechRecognizer.mRecognizer.

void voce.SpeechRecognizer.setEnabled boolean  e  ) 
 

Enables and disables the speech recognizer. Starts and stops the speech recognition thread.

Definition at line 174 of file SpeechRecognizer.java.

References voce.SpeechRecognizer.mMicrophone, voce.SpeechRecognizer.mRecognitionThread, voce.SpeechRecognizer.mRecognitionThreadRunning, and voce.SpeechRecognizer.mRecognizedStringQueue.

Referenced by voce.SpeechRecognizer.destroy(), and voce.SpeechInterface.setRecognizerEnabled().


Member Data Documentation

Microphone voce.SpeechRecognizer.mMicrophone = null [private]
 

The Microphone instance.

Definition at line 48 of file SpeechRecognizer.java.

Referenced by voce.SpeechRecognizer.isEnabled(), voce.SpeechRecognizer.run(), voce.SpeechRecognizer.setEnabled(), and voce.SpeechRecognizer.SpeechRecognizer().

volatile Thread voce.SpeechRecognizer.mRecognitionThread = null [private]
 

The thread used for speech recognition. This is necessary to avoid making applications wait for recognition to finish.

Definition at line 52 of file SpeechRecognizer.java.

Referenced by voce.SpeechRecognizer.run(), and voce.SpeechRecognizer.setEnabled().

boolean voce.SpeechRecognizer.mRecognitionThreadRunning = false [private]
 

A boolean that tracks whether the recognition thread is running.

Definition at line 55 of file SpeechRecognizer.java.

Referenced by voce.SpeechRecognizer.run(), and voce.SpeechRecognizer.setEnabled().

LinkedList<String> voce.SpeechRecognizer.mRecognizedStringQueue [private]
 

A queue of the recognized strings.

Definition at line 58 of file SpeechRecognizer.java.

Referenced by voce.SpeechRecognizer.getQueueSize(), voce.SpeechRecognizer.popString(), voce.SpeechRecognizer.run(), voce.SpeechRecognizer.setEnabled(), and voce.SpeechRecognizer.SpeechRecognizer().

Recognizer voce.SpeechRecognizer.mRecognizer = null [private]
 

The speech Recognizer instance.

Definition at line 45 of file SpeechRecognizer.java.

Referenced by voce.SpeechRecognizer.destroy(), voce.SpeechRecognizer.run(), and voce.SpeechRecognizer.SpeechRecognizer().


The documentation for this class was generated from the following file:
Generated on Wed Aug 3 16:25:02 2005 for Voce Java API by  doxygen 1.4.1