Class SpeechErrorEvent


public class SpeechErrorEvent extends ClientEvent<SpeechListener>
Event fired when speech recognition fails.
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • SpeechErrorEvent

      public SpeechErrorEvent(String message, String errorType)
      Constructs a SpeechErrorEvent.
      Parameters:
      message - The error message.
      errorType - The type of error.
  • Method Details

    • getMessage

      public String getMessage()
      Returns the error message.
      Returns:
      The error message.
    • getErrorType

      public String 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

      public void dispatchTo(SpeechListener listener)
      Description copied from class: Event
      Dispatches this event to the specified listener.

      Subclasses implement this method to call the appropriate handler method on the listener interface.

      Specified by:
      dispatchTo in class Event<SpeechListener>
      Parameters:
      listener - the listener to dispatch this event to
    • toString

      public String toString()
      Overrides:
      toString in class Object