com.cloudgarden.speech
Class CGEngineProperties

java.lang.Object
  |
  +--com.cloudgarden.speech.CGEngineProperties
All Implemented Interfaces:
EngineProperties

public class CGEngineProperties
extends java.lang.Object
implements EngineProperties

This class provides the standard methods of the EngineProperties interface, but also allows UI components specific to the Microsoft speech API to be displayed.


Field Summary
static int ADD_REMOVE_WORD_UI
           
static int AUDIO_PROPS_UI
           
static int AUDIO_VOL_UI
           
static int ENGINE_PROPS_UI
           
static int MIC_TRAINING_UI
           
static int RECO_PROFILE_UI
           
static int USER_TRAINING_UI
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void allowGuessingOfSpeaker(boolean allow)
          If set to "true" allows SAPI4 Recognizers to "guess" the current SpeakerProfile, so that subsequent calls to SpeakerManager.getCurrentSpeaker will return the profile that the engine is currently using.
 java.awt.Component getControlComponent()
          Obtain the AWT Component that provides the default user interface for setting the properties of this Engine.
 java.awt.Component getControlComponent(int type)
          Method allowing Microsoft-specific user-interfaces which are not available using the getControlComponent() method to be displayed.
 int getSapiVersion()
          Returns 4 for a SAPI4 engine or 5 for a SAPI5 engine
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void reset()
           
 void setEventsInNewThread(boolean inNewThread)
          Determines whether speech events are generated in separate Threads.
static boolean useFixForInfovox330()
           
static void useFixForInfovox330(boolean useFix)
          An exceptional method to allow synthesizers to get around bug in Infovox 330 (and possibly other versions of the engines) synthesizers regarding the wordReached events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_TRAINING_UI

public static final int USER_TRAINING_UI

RECO_PROFILE_UI

public static final int RECO_PROFILE_UI

ADD_REMOVE_WORD_UI

public static final int ADD_REMOVE_WORD_UI

ENGINE_PROPS_UI

public static final int ENGINE_PROPS_UI

MIC_TRAINING_UI

public static final int MIC_TRAINING_UI

AUDIO_PROPS_UI

public static final int AUDIO_PROPS_UI

AUDIO_VOL_UI

public static final int AUDIO_VOL_UI
Method Detail

setEventsInNewThread

public void setEventsInNewThread(boolean inNewThread)
Determines whether speech events are generated in separate Threads. The default is to start a new Thread for each event, but if this leads to poor performance then call this method to change the behaviour - but be prepared for deadlock to occur if you call waitEngineState in an event handler thread.

Note, the behaviour is set for each Engine individually.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface EngineProperties

getSapiVersion

public int getSapiVersion()
Returns 4 for a SAPI4 engine or 5 for a SAPI5 engine

allowGuessingOfSpeaker

public void allowGuessingOfSpeaker(boolean allow)
If set to "true" allows SAPI4 Recognizers to "guess" the current SpeakerProfile, so that subsequent calls to SpeakerManager.getCurrentSpeaker will return the profile that the engine is currently using. Default value is "false", so engine is not allowed to change speaker profiles without being directed to with the SpeakerManager.setCurrentSpeaker.

getControlComponent

public java.awt.Component getControlComponent()
Obtain the AWT Component that provides the default user interface for setting the properties of this Engine. If this Engine has no default control panel, the return is null
Specified by:
getControlComponent in interface EngineProperties
Returns:
A Component whose only useful method is show(). Calling this method will open the native user-interface modal window which can only be closed by the user.

getControlComponent

public java.awt.Component getControlComponent(int type)
Method allowing Microsoft-specific user-interfaces which are not available using the getControlComponent() method to be displayed. If this Engine does not support the specified type of UI control panel, the return is null.
Parameters:
type - one of the EngineProperties fields USER_TRAINING_UI, RECO_PROFILE_UI, ADD_REMOVE_WORD_UI, ENGINE_PROPS_UI, MIC_TRAINING_UI, AUDIO_PROPS_UI, or AUDIO_VOL_UI.
Returns:
A Component whose only useful method is show(). Calling this method will open the native user-interface modal window which can only be closed by the user.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface EngineProperties

reset

public void reset()
Specified by:
reset in interface EngineProperties

useFixForInfovox330

public static void useFixForInfovox330(boolean useFix)
An exceptional method to allow synthesizers to get around bug in Infovox 330 (and possibly other versions of the engines) synthesizers regarding the wordReached events. By default the fix is not used. Call this method (with a "true" argument) to apply the fix.

useFixForInfovox330

public static boolean useFixForInfovox330()