Package com.oorian.html.js.speech
Class SpeechErrorEvent
java.lang.Object
com.oorian.messaging.events.Event<SpeechListener>
com.oorian.messaging.events.client.ClientEvent<SpeechListener>
com.oorian.html.js.speech.SpeechErrorEvent
Event fired when speech recognition fails.
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSpeechErrorEvent(String message, String errorType) Constructs a SpeechErrorEvent. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchTo(SpeechListener listener) Dispatches this event to the specified listener.Returns the error type.Returns the error message.booleanReturns whether no speech was detected.booleanReturns whether permission was denied.toString()Methods inherited from class com.oorian.messaging.events.client.ClientEvent
getSource, getTarget, setSource, setTarget
-
Constructor Details
-
SpeechErrorEvent
Constructs a SpeechErrorEvent.- Parameters:
message- The error message.errorType- The type of error.
-
-
Method Details
-
getMessage
Returns the error message.- Returns:
- The error message.
-
getErrorType
Returns the error type.Common error types:
- no-speech: No speech was detected
- aborted: Recognition was aborted
- audio-capture: Audio capture failed
- network: Network error
- not-allowed: Permission denied
- service-not-allowed: Service not allowed
- bad-grammar: Grammar error
- language-not-supported: Language not supported
- Returns:
- The error type.
-
isNoSpeech
public boolean isNoSpeech()Returns whether no speech was detected.- Returns:
- True if no speech was detected.
-
isPermissionDenied
public boolean isPermissionDenied()Returns whether permission was denied.- Returns:
- True if permission was denied.
-
dispatchTo
Description copied from class:EventDispatches this event to the specified listener.Subclasses implement this method to call the appropriate handler method on the listener interface.
- Specified by:
dispatchToin classEvent<SpeechListener>- Parameters:
listener- the listener to dispatch this event to
-
toString
-