Package com.oorian.html.js.speech
Class SpeechResultEvent
java.lang.Object
com.oorian.messaging.events.Event<SpeechListener>
com.oorian.messaging.events.client.ClientEvent<SpeechListener>
com.oorian.html.js.speech.SpeechResultEvent
Event fired when speech recognition produces a result.
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSpeechResultEvent(String transcript, float confidence, boolean isFinal) Constructs a SpeechResultEvent. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchTo(SpeechListener listener) Dispatches this event to the specified listener.floatReturns the confidence score.Returns the recognized text.booleanisFinal()Returns whether this is a final result.booleanReturns whether this is an interim (non-final) result.toString()Methods inherited from class com.oorian.messaging.events.client.ClientEvent
getSource, getTarget, setSource, setTarget
-
Constructor Details
-
SpeechResultEvent
Constructs a SpeechResultEvent.- Parameters:
transcript- The recognized text.confidence- Confidence score (0.0 to 1.0).isFinal- True if this is a final result, false if interim.
-
-
Method Details
-
getTranscript
Returns the recognized text.- Returns:
- The transcript.
-
getConfidence
public float getConfidence()Returns the confidence score.- Returns:
- Confidence from 0.0 (no confidence) to 1.0 (high confidence).
-
isFinal
public boolean isFinal()Returns whether this is a final result.Interim results may change as more audio is processed. Final results are the speech recognizer's best interpretation.
- Returns:
- True if final, false if interim.
-
isInterim
public boolean isInterim()Returns whether this is an interim (non-final) result.- Returns:
- True if interim.
-
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
-