examples.recognition
Class TestResultListener

java.lang.Object
  |
  +--javax.speech.recognition.ResultAdapter
        |
        +--examples.recognition.TestResultListener
All Implemented Interfaces:
java.util.EventListener, ResultListener

public class TestResultListener
extends ResultAdapter

Class to print out result events, and deallocate the recognizer after a given number of accepted results. Also demonstrates playback of recorded speech and use of tokenCorrection (except the actual tokenCorrection line has been commented out).


Constructor Summary
TestResultListener(Recognizer rec, int nRecs, boolean playAudio)
          Creates a TestResultListener which will deallocate the given Recognizer after "nRecs" accepted recognitions, and will re-play the recorded audio if "playAudio" is true (and audio is being saved using RecognizerProperties.setResultAudioProvided(true))
 
Method Summary
 void resultAccepted(ResultEvent e)
           
 void resultCreated(ResultEvent e)
           
 void resultRejected(ResultEvent e)
           
 void resultUpdated(ResultEvent e)
           
 
Methods inherited from class javax.speech.recognition.ResultAdapter
audioReleased, grammarFinalized, trainingInfoReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestResultListener

public TestResultListener(Recognizer rec,
                          int nRecs,
                          boolean playAudio)
Creates a TestResultListener which will deallocate the given Recognizer after "nRecs" accepted recognitions, and will re-play the recorded audio if "playAudio" is true (and audio is being saved using RecognizerProperties.setResultAudioProvided(true))
Method Detail

resultRejected

public void resultRejected(ResultEvent e)
Overrides:
resultRejected in class ResultAdapter

resultCreated

public void resultCreated(ResultEvent e)
Overrides:
resultCreated in class ResultAdapter

resultUpdated

public void resultUpdated(ResultEvent e)
Overrides:
resultUpdated in class ResultAdapter

resultAccepted

public void resultAccepted(ResultEvent e)
Overrides:
resultAccepted in class ResultAdapter