socket
Class SpeechHandler

java.lang.Object
  extended by socket.SpeechHandler

public class SpeechHandler
extends java.lang.Object

The method startupRecognitionServer runs the external "recserver" command.


Nested Class Summary
 class SpeechHandler.RunnableRecognition
          When running this thread: the client connects to the regserver.
 
Field Summary
(package private)  java.lang.String[] backupPromptPath
           
private  CalendarConfiguration calendarConf
           
private static boolean computeXCPUTime
           
private  Language currentLanguage
           
private  java.lang.String currentRecognitionPackage
           
private  java.lang.String grammar
           
private  java.lang.String lastWavFileRecorded
           
private  boolean lastWavFileRetrieved
           
private  java.lang.String logDirectory
           
private static java.util.logging.Logger logger
           
private  net.sf.regulus.NBestRegResult nbestRegResult
           
private  java.lang.String promptPrefix
           
private  java.lang.Process recServerProcess
           
private static net.sf.regulus.RegClient regClient
           
private  java.lang.Process ttsProcess
           
 
Constructor Summary
SpeechHandler(CalendarConfiguration calendarConf, ApplicationState appState)
          Constructor
 
Method Summary
 void abortPlayback()
           
 void abortRecognition()
          Abort an ongoing recognition
 java.lang.String getLastWavFileRecorded()
           
 net.sf.regulus.NBestRegResult getNbestRegResult()
           
 int getParamWriteWaveForms()
           
 java.lang.String getPrimaryGrammar()
          Gets the primaryGrammar used in recognition
 net.sf.regulus.RegClient getRegClient()
           
 void playback(java.lang.String playback_string)
           
 java.lang.String recognizeFile(java.lang.String file, java.lang.String grammar)
           
protected  void reconfigure(ApplicationState newAppState)
           
 void sendMsgToRegServer(java.lang.String msg)
           
 void setComputeCPUTimeEnabled(boolean enabled)
           
 boolean setParam(java.lang.String param, java.lang.String value)
           
 void setWaitDialogMessage(int progress, java.lang.String message)
           
 boolean shutdown()
           
private  void shutdownPlayback()
          stops any TTS processes running
private  void shutdownRecognition()
           
 net.sf.regulus.NBestRegResult startRecognition()
          Start a recognition request in a new thread and
 void startup()
           
private  void startupRecognition()
          Starts recognition server and client
private  void startupRecognitionServer()
          This simply runs the external "recserver" command
private  void startupRegServer()
          Invoke Regserver with GLM
private  void startupVocalizer()
          Run vocaliser with tts parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static java.util.logging.Logger logger

calendarConf

private final CalendarConfiguration calendarConf

currentLanguage

private Language currentLanguage

regClient

private static net.sf.regulus.RegClient regClient

recServerProcess

private java.lang.Process recServerProcess

ttsProcess

private java.lang.Process ttsProcess

promptPrefix

private java.lang.String promptPrefix

grammar

private java.lang.String grammar

currentRecognitionPackage

private java.lang.String currentRecognitionPackage

lastWavFileRecorded

private java.lang.String lastWavFileRecorded

logDirectory

private java.lang.String logDirectory

lastWavFileRetrieved

private boolean lastWavFileRetrieved

computeXCPUTime

private static boolean computeXCPUTime

backupPromptPath

java.lang.String[] backupPromptPath

nbestRegResult

private net.sf.regulus.NBestRegResult nbestRegResult
Constructor Detail

SpeechHandler

public SpeechHandler(CalendarConfiguration calendarConf,
                     ApplicationState appState)
Constructor

Parameters:
calendarRootComponent -
calendarConf -
appState -
Method Detail

getNbestRegResult

public net.sf.regulus.NBestRegResult getNbestRegResult()

startup

public void startup()
             throws java.lang.Exception
Throws:
java.lang.Exception

startupVocalizer

private void startupVocalizer()
Run vocaliser with tts parameters.


shutdownPlayback

private void shutdownPlayback()
stops any TTS processes running


shutdown

public boolean shutdown()

startupRegServer

private void startupRegServer()
                       throws java.lang.Exception
Invoke Regserver with GLM

Throws:
java.lang.Exception

startupRecognitionServer

private void startupRecognitionServer()
                               throws java.lang.Exception
This simply runs the external "recserver" command

Throws:
java.lang.Exception

startupRecognition

private void startupRecognition()
                         throws java.lang.Exception
Starts recognition server and client

Throws:
FatalException
NuanceConfigException
java.lang.Exception

startRecognition

public net.sf.regulus.NBestRegResult startRecognition()
Start a recognition request in a new thread and

Returns:
true if the recognition was successful and the interpretation (message to be sent to the dialogue server) was created

abortRecognition

public void abortRecognition()
Abort an ongoing recognition


getPrimaryGrammar

public java.lang.String getPrimaryGrammar()
Gets the primaryGrammar used in recognition


shutdownRecognition

private void shutdownRecognition()

reconfigure

protected void reconfigure(ApplicationState newAppState)
                    throws java.lang.Exception
Parameters:
newAppState -
Throws:
java.lang.Exception

playback

public void playback(java.lang.String playback_string)
              throws java.lang.Exception
Parameters:
string -
Throws:
java.lang.Exception

abortPlayback

public void abortPlayback()

getLastWavFileRecorded

public java.lang.String getLastWavFileRecorded()
Returns:
Returns the lastWavFileRecorded.

getParamWriteWaveForms

public int getParamWriteWaveForms()
Returns:
Returns the lastWavFileRecorded.

setParam

public boolean setParam(java.lang.String param,
                        java.lang.String value)
Returns:
Returns the lastWavFileRecorded.

setWaitDialogMessage

public void setWaitDialogMessage(int progress,
                                 java.lang.String message)

setComputeCPUTimeEnabled

public void setComputeCPUTimeEnabled(boolean enabled)
Parameters:
b -

sendMsgToRegServer

public void sendMsgToRegServer(java.lang.String msg)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getRegClient

public net.sf.regulus.RegClient getRegClient()

recognizeFile

public java.lang.String recognizeFile(java.lang.String file,
                                      java.lang.String grammar)
                               throws java.io.IOException
Throws:
java.io.IOException