public interface UserInput
Objects that implement this interface are able to detect and report character and/or spoken input simultaneously and to control input detection interval duration with a timer whose length is specified by a VoiceXML document.
If an input resource is not available, an error.noresource event
must be thrown.
| Modifier and Type | Method and Description |
|---|---|
int |
activateGrammars(java.util.Collection<GrammarDocument> grammars)
Activates the given grammars.
|
int |
deactivateGrammars(java.util.Collection<GrammarDocument> grammars)
Deactivates the given grammars.
|
java.util.Collection<org.jvoicexml.xml.vxml.BargeInType> |
getSupportedBargeInTypes()
Retrieves the barge-in types supported by this
UserInput. |
java.util.Collection<org.jvoicexml.xml.srgs.GrammarType> |
getSupportedGrammarTypes(org.jvoicexml.xml.srgs.ModeType mode)
Retrieves the grammar types that are supported by this implementation for
the given mode.
|
void |
startRecognition(DataModel model,
java.util.Collection<org.jvoicexml.xml.srgs.ModeType> types,
SpeechRecognizerProperties speech,
DtmfRecognizerProperties dtmf)
Detects and reports character and/or spoken input simultaneously.
|
void |
stopRecognition(java.util.Collection<org.jvoicexml.xml.srgs.ModeType> types)
Stops a previously started recognition.
|
void startRecognition(DataModel model, java.util.Collection<org.jvoicexml.xml.srgs.ModeType> types, SpeechRecognizerProperties speech, DtmfRecognizerProperties dtmf) throws NoresourceError, BadFetchError
model - the data model for generating a semantic interpretationtypes - the recognizer types to activatespeech - the speech recognizer properties to usedtmf - the DTMF recognizer properties to useNoresourceError - The input resource is not available.BadFetchError - The active grammar contains some errors.void stopRecognition(java.util.Collection<org.jvoicexml.xml.srgs.ModeType> types)
types - the recognizer types to activate, null would stop all
recognizersstartRecognition(org.jvoicexml.interpreter.datamodel.DataModel, java.util.Collection<org.jvoicexml.xml.srgs.ModeType>, org.jvoicexml.SpeechRecognizerProperties, org.jvoicexml.DtmfRecognizerProperties)java.util.Collection<org.jvoicexml.xml.srgs.GrammarType> getSupportedGrammarTypes(org.jvoicexml.xml.srgs.ModeType mode)
It is guaranteed that the implementation is only asked to activate (
activateGrammars(Collection)) and deactivate (
deactivateGrammars(Collection)) grammars who's format
is returned by this method.
mode - grammar modeint activateGrammars(java.util.Collection<GrammarDocument> grammars) throws BadFetchError, UnsupportedLanguageError, NoresourceError, UnsupportedFormatError
getSupportedGrammarTypes(ModeType).
GrammarImplementations may be
cached. This means that a grammar implementation object is loaded either
by this or by another instance of the UserInput. For some
implementation platforms it may be necessary that the instance activating
the grammar also loaded the grammar. In these cases, the grammar
implementation must be loaded in this call. The grammar source may be
accessed by the grammar implementation itself, e.g. SRGS grammar sources
can be accessed via
SrgsXmlGrammarImplementation.getGrammarDocument()
.
grammars - grammars to activate. This collection may contain grammars
that already have been activated by a previous call to this
method. It is up to the implementation to distinguish if the
grammar is already active or not.BadFetchError - Grammar is not known by the recognizer.UnsupportedLanguageError - The specified language is not supported.NoresourceError - The input resource is not available.UnsupportedFormatError - the grammar format is not supportedint deactivateGrammars(java.util.Collection<GrammarDocument> grammars) throws NoresourceError, BadFetchError
grammars - Grammars to deactivate.BadFetchError - Grammar is not known by the recognizer.NoresourceError - The input resource is not available.java.util.Collection<org.jvoicexml.xml.vxml.BargeInType> getSupportedBargeInTypes()
UserInput.