edu.cmu.sphinx.jsapi
Class SphinxRecognizer

java.lang.Object
  extended bycom.sun.speech.engine.BaseEngine
      extended bycom.sun.speech.engine.recognition.BaseRecognizer
          extended byedu.cmu.sphinx.jsapi.SphinxRecognizer
All Implemented Interfaces:
Engine, Recognizer, com.sun.speech.engine.SpeechEventDispatcher

public class SphinxRecognizer
extends com.sun.speech.engine.recognition.BaseRecognizer

A SphinxRecognizer provides access to Sphinx speech recognition capabilities.


Field Summary
 
Fields inherited from class com.sun.speech.engine.recognition.BaseRecognizer
currentGrammar
 
Fields inherited from interface javax.speech.recognition.Recognizer
FOCUS_OFF, FOCUS_ON, LISTENING, PROCESSING, SUSPENDED
 
Fields inherited from interface javax.speech.Engine
ALLOCATED, ALLOCATING_RESOURCES, DEALLOCATED, DEALLOCATING_RESOURCES, PAUSED, RESUMED
 
Constructor Summary
SphinxRecognizer()
          Creates the default sphinx recognizer
SphinxRecognizer(SphinxRecognizerModeDesc modeDesc)
          Creates a sphinx 4 recognizer that matches the given mode descriptor
 
Method Summary
 void allocate()
          Allocate the resources required for the Engine and put it into the ALLOCATED state
 void deallocate()
          Free the resoures of the engine that were acquired during allocation and operation, and return the engine to the DEALLOCATED state.
 void pause()
          Pauses the audio stream for the engine, puts the engine into the PAUSED state
 void resume()
          Resumes the audio stream for the engine, puts the engine into the RESUMED state
 
Methods inherited from class com.sun.speech.engine.recognition.BaseRecognizer
addResultListener, commitChanges, deleteRuleGrammar, dispatchSpeechEvent, fireAudioReleased, fireChangesCommitted, fireFocusGained, fireFocusLost, fireGrammarFinalized, fireRecognizerProcessing, fireRecognizerSuspended, fireResultAccepted, fireResultCreated, fireResultRejected, fireResultUpdated, fireTrainingInfoReleased, forceFinalize, getAudioManager, getDictationGrammar, getRecognizerProperties, getRuleGrammar, getSpeakerManager, listRuleGrammars, loadAllImports, loadJSGF, loadJSGF, loadJSGF, loadJSGF, newRuleGrammar, notifyResult, postAudioReleased, postGrammarFinalized, postResultAccepted, postResultCreated, postResultRejected, postResultUpdated, postTrainingInfoReleased, readVendorGrammar, readVendorResult, rejectUtterance, releaseFocus, removeResultListener, requestFocus, suspend, writeVendorGrammar, writeVendorResult
 
Methods inherited from class com.sun.speech.engine.BaseEngine
addEngineListener, fireEngineAllocated, fireEngineAllocatingResources, fireEngineDeallocated, fireEngineDeallocatingResources, fireEnginePaused, fireEngineResumed, getEngineModeDesc, getEngineProperties, getEngineState, getVocabManager, removeEngineListener, testEngineState, toString, waitEngineState
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.speech.Engine
addEngineListener, getEngineModeDesc, getEngineProperties, getEngineState, getVocabManager, removeEngineListener, testEngineState, waitEngineState
 

Constructor Detail

SphinxRecognizer

public SphinxRecognizer()
Creates the default sphinx recognizer


SphinxRecognizer

public SphinxRecognizer(SphinxRecognizerModeDesc modeDesc)
Creates a sphinx 4 recognizer that matches the given mode descriptor

Parameters:
modeDesc - the mode descriptor describing the type of recognizer to create
Method Detail

pause

public void pause()
           throws EngineStateError
Pauses the audio stream for the engine, puts the engine into the PAUSED state

Throws:
EngineStateError - - if called for an engine in the DEALLOCATED or DEALLOCATING_RESOURCES states.

resume

public void resume()
            throws AudioException,
                   EngineStateError
Resumes the audio stream for the engine, puts the engine into the RESUMED state

Throws:
EngineStateError - - if called for an engine in the DEALLOCATED or DEALLOCATING_RESOURCES states.
AudioException - if unable to gain acces to the audio channel

allocate

public void allocate()
              throws EngineException,
                     EngineStateError
Allocate the resources required for the Engine and put it into the ALLOCATED state

Throws:
EngineException - if an allocation error occurred or the engine is not operational
EngineStateError - if called for an engine in the DEALLOCATING_RESOURCES state.

deallocate

public void deallocate()
                throws EngineException,
                       EngineStateError
Free the resoures of the engine that were acquired during allocation and operation, and return the engine to the DEALLOCATED state.

Throws:
EngineException - if a deallocation error occurred
EngineStateError - if called for an engine in the ALLOCATING_RESOURCES state.