|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.implementation.jsapi10.AudioInput
public final class AudioInput
Audio input that uses the JSAPI 1.0 to address the recognition engine.
Handle all JSAPI calls to the recognizer to make JSAPI transparent to the interpreter.
Copyright © 2005-2007 JVoiceXML group - http://jvoicexml.sourceforge.net/
| Constructor Summary | |
|---|---|
AudioInput(RecognizerModeDesc defaultDescriptor)
Constructs a new audio input. |
|
| Method Summary | |
|---|---|
void |
activate()
Activates this resource, when it is retrieved from the pool. |
void |
activateGrammars(Collection<GrammarImplementation<? extends Object>> grammars)
Activates the given grammars. |
void |
close()
Closes and releases the acquired resources. |
void |
connect(RemoteClient remoteclient)
Establishes a connection from the given RemoteClient to this
object. |
void |
deactivateGrammars(Collection<GrammarImplementation<? extends Object>> grammars)
Deactivates the given grammar. |
Collection<BargeInType> |
getSupportedBargeInTypes()
Retrieves the barge-in types supported by this UserInput. |
Collection<GrammarType> |
getSupportedGrammarTypes()
Retrieves the grammar types that are supported by this implementation. |
String |
getType()
Retrieves a unique identifier for this external resource. |
GrammarImplementation<RuleGrammar> |
loadGrammar(Reader reader,
GrammarType type)
Creates a GrammarImplementation from the contents provided by
the Reader. |
GrammarImplementation<RuleGrammar> |
newGrammar(String name,
GrammarType type)
Creates a new grammar of the given type for this recognizer with a specified grammar name. |
void |
open()
Initializes and and acquires the needed resources. |
void |
passivate()
Passivates this resource, when it is returned to the pool. |
void |
record(OutputStream out)
Records audio received from the user. |
void |
setUserInputListener(UserInputListener inputListener)
Sets the listener for user input events. |
void |
startRecognition()
Detects and reports character and/or spoken input simultaneously. |
void |
stopRecognition()
Stops a previously started recognition. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AudioInput(RecognizerModeDesc defaultDescriptor)
defaultDescriptor - the default recognizer mode descriptor.| Method Detail |
|---|
public void open()
throws NoresourceError
open in interface ExternalResourceNoresourceError - The resource could not be opened.public void close()
close in interface ExternalResourcepublic void setUserInputListener(UserInputListener inputListener)
The implementation of this interface must notify the listener about all events.
Note: This method might not be called, e.g. if there is
no UserInput.
setUserInputListener in interface ObservableUserInputinputListener - The listener.public Collection<BargeInType> getSupportedBargeInTypes()
UserInput.
getSupportedBargeInTypes in interface SpokenInput
public GrammarImplementation<RuleGrammar> newGrammar(String name,
GrammarType type)
throws NoresourceError
newGrammar in interface SpokenInputname - Name of the grammar to be created.type - type of the grammar to read. The type is one of the
supported types of the implementation, that has been
requested via SpokenInput.getSupportedGrammarTypes().
NoresourceError - If the input device is not available.
public GrammarImplementation<RuleGrammar> loadGrammar(Reader reader,
GrammarType type)
throws NoresourceError,
BadFetchError,
UnsupportedFormatError
GrammarImplementation from the contents provided by
the Reader. If the grammar contained in the Reader already exists, it is
over-written.
loadGrammar in interface SpokenInputreader - The Reader from which the grammar text is loadedtype - type of the grammar to read. The type is one of the supported
types of the implementation, that has been requested via
SpokenInput.getSupportedGrammarTypes().
NoresourceError - The input resource is not available.
BadFetchError - Error reading the grammar.
UnsupportedFormatError - Invalid grammar format.
public void activateGrammars(Collection<GrammarImplementation<? extends Object>> grammars)
throws BadFetchError,
UnsupportedLanguageError,
NoresourceError
activateGrammars in interface SpokenInputgrammars - Grammars to activate.
BadFetchError - Grammar is not know by the recognizer.
UnsupportedLanguageError - The specified language is not supported.
NoresourceError - The input resource is not available.
public void deactivateGrammars(Collection<GrammarImplementation<? extends Object>> grammars)
throws BadFetchError
deactivateGrammars in interface SpokenInputgrammars - Grammars to deactivate.
BadFetchError - Grammar is not known by the recognizer.
public void record(OutputStream out)
throws NoresourceError
record in interface SpokenInputout - OutputStream to write the recorded audio.
NoresourceError - The input resource is not available.
public void startRecognition()
throws NoresourceError,
BadFetchError
startRecognition in interface InputDeviceNoresourceError - The input resource is not available.
BadFetchError - The active grammar contains some errors.public void stopRecognition()
stopRecognition in interface InputDeviceInputDevice.startRecognition()public void activate()
activate in interface ExternalResourceactivate in interface SpokenInputpublic void passivate()
passivate in interface ExternalResourcepassivate in interface SpokenInput
public void connect(RemoteClient remoteclient)
throws IOException
RemoteClient to this
object.
connect in interface RemoteConnectableremoteclient - data container with connection relevant data.
IOException - error establishing the connection.public String getType()
getType in interface ExternalResourcepublic Collection<GrammarType> getSupportedGrammarTypes()
getSupportedGrammarTypes in interface SpokenInput
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||