|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.speech.recognition.EmbeddedRecognizer
android.speech.recognition.impl.EmbeddedRecognizerImpl
public class EmbeddedRecognizerImpl
| Constructor Summary | |
|---|---|
EmbeddedRecognizerImpl()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
configure(String config)
Configures the recognizer. |
Grammar |
createGrammar(String value,
GrammarListener listener)
Creates an embedded grammar. |
static EmbeddedRecognizerImpl |
getInstance()
Returns the singleton instance. |
void |
getParameters(Vector<String> params)
Retrieves the values of recognition parameters. |
void |
recognize(AudioStream audio,
Grammar grammar)
This convenience method is equivalent to invoking recognize(audio, grammars) with a single grammar. |
void |
recognize(AudioStream audio,
Vector<Grammar> grammars)
Begins speech recognition. |
void |
resetAcousticState()
The recognition accuracy improves over time as the recognizer adapts to the surrounding environment. |
void |
run()
Begin doing the active part of the class' code. |
void |
setListener(RecognizerListener listener)
Sets the recognizer event listener. |
void |
setParameters(Hashtable<String,String> params)
Sets the values of recognition parameters. |
void |
stop()
Terminates a recognition if one is in-progress. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
EmbeddedRecognizerImpl()
| Method Detail |
|---|
public static EmbeddedRecognizerImpl getInstance()
public void run()
Runnable
run in interface Runnable
public void configure(String config)
throws IllegalArgumentException,
FileNotFoundException,
IOException,
UnsatisfiedLinkError,
ClassNotFoundException
EmbeddedRecognizer
configure in class EmbeddedRecognizerconfig - recognizer configuration file
IllegalArgumentException - if config is null or an empty string
FileNotFoundException - if the specified file could not be found
IOException - if the specified file could not be opened
UnsatisfiedLinkError - if the recognizer plugin could not be loaded
ClassNotFoundException - if the recognizer plugin could not be foundpublic void setListener(RecognizerListener listener)
Recognizer
setListener in interface Recognizerlistener - listens for recognizer events
public Grammar createGrammar(String value,
GrammarListener listener)
throws IllegalArgumentException
Recognizer
createGrammar in interface Recognizervalue - value of that grammarType. Could be a URL or an inline grammar.
IllegalArgumentException - if value is null or listener is not of type
GrammarListener.public void resetAcousticState()
EmbeddedRecognizer
resetAcousticState in class EmbeddedRecognizer
public void recognize(AudioStream audio,
Vector<Grammar> grammars)
Recognizer
recognize in interface Recognizeraudio - the audio stream to recognizergrammars - a collection of grammar sets to recognize againstRecognizer.recognize(AudioStream, Grammar)
public void recognize(AudioStream audio,
Grammar grammar)
Recognizer
recognize in interface Recognizeraudio - the audio to recognizergrammar - a grammar to recognize againstRecognizer.recognize(AudioStream, Vector)public void stop()
Recognizer
stop in interface RecognizerRecognizerListener.onStopped()public void setParameters(Hashtable<String,String> params)
Recognizer
setParameters in interface Recognizerparams - the parameter key-value pairs to setpublic void getParameters(Vector<String> params)
Recognizer
getParameters in interface Recognizerparams - the names of the parameters to retrieve
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||