vxmlsurfer
Class Processor

java.lang.Object
  extended by java.util.Observable
      extended by vxmlsurfer.Processor
All Implemented Interfaces:
java.lang.Runnable, java.util.Observer

public class Processor
extends java.util.Observable
implements java.util.Observer, java.lang.Runnable

This class controls the execution of the vxml file.

Author:
Eugene Borodin, Padmini Patnaik, Elton Pereira, Apoorva Mehra

Field Summary
(package private) static int BREAK_DEFAULT
           
(package private) static int BREAK_LARGE
           
(package private) static int BREAK_MEDIUM
           
(package private) static int BREAK_NONE
           
(package private) static int BREAK_SMALL
           
 int cepstral_index
           
(package private) static int CEPSTRAL_SLOWEST
           
(package private)  javax.speech.synthesis.Voice[] cepstral_voices
           
(package private)  java.lang.String[][] colorCombos
           
(package private)  int counter
           
 int curEngine
           
(package private)  java.lang.String currentApplicationFile
           
(package private)  int currVoice
           
(package private) static java.lang.String DOM_PARSER_IMP
           
(package private) static java.lang.String EVENTS_PATH
           
(package private) static java.lang.String LOGGER_SETTINGS
           
(package private)  java.lang.String[] names
           
 java.lang.String registerEngine
           
(package private)  java.util.Map<java.lang.String,java.lang.Object> returnSubdialog
           
 java.lang.StringBuffer str
           
(package private) static javax.speech.synthesis.Synthesizer synth
           
(package private)  javax.speech.synthesis.SynthesizerProperties synthProp
           
(package private) static int TTS_FASTEST
           
(package private) static int TTS_HIGHEST
           
 int tts_index
           
(package private) static float TTS_LOUDEST
           
(package private) static int TTS_LOWEST
           
(package private) static int TTS_PITCH_CHANGE
           
(package private) static float TTS_QUIETEST
           
(package private) static int TTS_RATE_CHANGE
           
(package private) static int TTS_SLOWEST
           
(package private) static float TTS_VOLUME_CHANGE
           
(package private)  javax.speech.synthesis.Voice[] voices
           
(package private) static java.lang.String VXML_VERSION
           
 
Constructor Summary
Processor()
          The only Constructor of this class.
 
Method Summary
 void addToCache(java.lang.String key, java.io.ByteArrayInputStream byteStream)
          Adds the ByteArrayInputStream object into the cache mapped to the given key.
 void allocateVoice()
          Allocates voice resources
 void buildDialogTable(org.w3c.dom.Document doc, java.util.Map dialogTable)
          This is a pre-processing step.
 void changeColor()
          this function changes forgroung and background color
 org.w3c.dom.Node chooseAppropriateHandler(java.lang.String event)
          Finds the appropriate handler for the event.
 org.w3c.dom.ls.LSInput createInput(java.lang.String pathname)
          This method creates the LSInput object for those uri that are not present in the cache.
 void deAllocateVoice()
          Deallocates Voice Resources
 org.w3c.dom.ls.LSInput fetchFromCache(java.lang.String key)
          Fetches the ByteArrayInputStream object into the cache mapped to the given key and convertes it into LSInput
 java.io.ByteArrayInputStream getByteStream(java.lang.String pathname)
          Creates a ByteArrayInput Stream for the given pathname.
 int getCurrEngine()
          returns current TTS engine
 int getCurrVoice()
          Used to get current voice
 boolean getDiskAccess()
          this function tells us weather vxml file should be read from disk or in-memory data structure
 java.lang.String[] getEventList(org.w3c.dom.Node ast)
          Returns a String array of event names
 float getTTS_pitch()
          Used to get current pitch
 float getTTS_rate()
          Used to get current rate
 float getTTS_volume()
          Used to get current volume
 void iAssign(org.w3c.dom.Node ast)
          Implementation of the element.
 void iAudio(org.w3c.dom.Node ast)
          Implementation of the element.
 void iBlock(org.w3c.dom.Node ast)
          Implementation of the element.
 void iBreak(org.w3c.dom.Node ast)
          Implementation of the element.
 void iClear(org.w3c.dom.Node ast)
          Implementation of the element.
 void iData(org.w3c.dom.Node ast)
          Implementation of the element.
 void iDisconnect(org.w3c.dom.Node ast)
          Implementation of the element.
 void iElse(org.w3c.dom.Node ast)
          Implementation of the element.
 void iElseif(org.w3c.dom.Node ast)
          Implementation of the element.
 void iEmphasis(org.w3c.dom.Node ast)
          Implementation of the element.
 void iExample(org.w3c.dom.Node ast)
          Implementation of the element.
 void iExit(org.w3c.dom.Node ast)
          Implementation of the element.
 void iField(org.w3c.dom.Node ast)
          Implementation of the element.
 void iFilled(org.w3c.dom.Node ast)
          Implementation of the element.
 void iForm(org.w3c.dom.Node ast)
          Implementation of the
element.
 void iGoto(org.w3c.dom.Node ast)
          Implementation of the element.
 void iGrammar(org.w3c.dom.Node ast)
          Implementation of the element.
 void iIf(org.w3c.dom.Node ast)
          Implementation of the element.
 void iInitial(org.w3c.dom.Node ast)
          Implementation of the element.
 void iLog(org.w3c.dom.Node ast)
          Implementation of the element.
 void iMark(org.w3c.dom.Node ast)
          Implementation of the element.
 void iMenu(org.w3c.dom.Node ast)
          Implementation of the element.
 void iMeta(org.w3c.dom.Node ast)
          Implementation of the element.
 void iMetadata(org.w3c.dom.Node ast)
          Implementation of the element.
 void initializeVars(org.w3c.dom.Node ast)
          Given an AST, initializes all variables, NAMED form item variable, properties, and scripts.
 void input()
          Tries to get a message from the queue.
 void inputFromURI(boolean mode)
          Set file or text input - default is true - TEXT
 void iObject(org.w3c.dom.Node ast)
          Implementation of the element.
 void iOneOf(org.w3c.dom.Node ast)
          Implementation of the element.
 void iOption(org.w3c.dom.Node ast)
          Implementation of the
 void iP(org.w3c.dom.Node ast)
          Implementation of the
 void iParagraph(org.w3c.dom.Node ast)
          Implementation of the element.
 void iPhoneme(org.w3c.dom.Node ast)
          Implementation of the element.
 void iPrompt(org.w3c.dom.Node ast)
          Implementation of the element.
 void iProperty(org.w3c.dom.Node ast)
          Implementation of the element.
 void iRecord(org.w3c.dom.Node ast)
          Implementation of the element.
 void iReprompt(org.w3c.dom.Node ast)
          Implementation of the element.
 void iReturn(org.w3c.dom.Node ast)
          Implementation of the element.
 void iRuleRef(org.w3c.dom.Node ast)
          Implementation of the element.
 void iS(org.w3c.dom.Node ast)
          Implementation of the element.
 void iScript(org.w3c.dom.Node ast)
          Implementation of the element.
 void iSentence(org.w3c.dom.Node ast)
          Implementation of the element.
 void iSub(org.w3c.dom.Node ast)
          Implementation of the element.
 void iSubdialog(org.w3c.dom.Node ast)
          Implementation of the element.
 void iSubmit(org.w3c.dom.Node ast)
          Implementation of the element.
 void iTag(org.w3c.dom.Node ast)
          Implementation of the element.
 java.lang.String iText(org.w3c.dom.Node ast)
          Implementation of the element.
 void iThrow(org.w3c.dom.Node ast)
          Implementation of the element.
 void iToken(org.w3c.dom.Node ast)
          Implementation of the element.
 void iTransfer(org.w3c.dom.Node ast)
          Implementation of the element.
 void iUserinput()
          Implementation of the element.
 java.lang.String iValue(org.w3c.dom.Node ast)
          Implementation of the element.
 void iVar(org.w3c.dom.Node ast)
          Implementation of the element.
 void iVoice(org.w3c.dom.Node ast)
          Implementation of the element.
 void iVxml(org.w3c.dom.Node ast)
          Implementation of the element.
 void loadDefaultEvents(java.io.File dir)
          Load default events - recursively process folder takes File structure to the directory, and the path to the directory
 void loadVxmlContext(org.w3c.dom.Document doc, java.lang.String name)
          Creates the dialog table, creates a document level scope, and pushes events.
 java.lang.String nameUnnamedFormItem(org.w3c.dom.Node ast)
          Given an item AST, return the/a item name for it.
 void output(java.lang.String txt)
          Output line
 void outputText(java.lang.String txt)
          Method to read out the text if it is not empty.
 org.w3c.dom.Document parse(java.lang.String input)
          Parses the given input string.
 org.w3c.dom.Document ParseText(java.lang.String vxmlIn)
          Parses the given string as a VXML file.
 org.w3c.dom.Document ParseURI(java.lang.String vxml)
          Fetches the LSInput object refered to by the vxml string and parses it.
 void pauseTTS()
          pauses TTS
 void processIO()
          Process Input queue
 void pushEvents(ApplicationContext context, org.w3c.dom.Node ast)
          Creates new event scope, takes the ApplicationContext and event handler
 void rangeSettings()
           
 void restartUtterance()
          restart Current Utterance
 void resumeTTS()
          resumes TTS
 void run()
          Runnable run method implementation Execute the required task and go to wait.
 java.util.Map Run(java.lang.String URI)
          This method is the one that should be called by any external package that needs to run a vxml application.
 void runDialog(org.w3c.dom.Node ast)
          Runs the handler that corresponds to the correct dialog.
 void runHandler(java.lang.String handler)
          Execute Hardcoded Handlers
 void runURI(boolean subdialog)
          Executes the vxml file.
 void setAppl(CleanExit appl)
           
 void setCurrEngine(int currEngine)
           
 void setCurrVoice(int currVoice)
          Used to change current voice.
 void setDiskAccess(boolean disk_access)
          this function tells sets variable indicating weather vxml file should be read from disk or in-memory data structure.
 void setPath(java.lang.String path)
          Sets the current execution path.
 void setTTS_pitch(float tts_pitch)
          Used to change current pitch
 void setTTS_rate(float tts_rate)
          Used to change current rate
 void setTTS_volume(float tts_volume)
          Used to change current volume
 void skipUtterance()
          Skip Current Utterance
 void startVoiceRecognizer()
          This function is called to start the voice recognizer
 void stopAndExit()
          Stops tts and player and sets state to exit
 void stopAudioPlayer()
          Closes the audio player
 void terminate()
          This function is called for clean exit
 void throwEvent(java.lang.String event, java.lang.String message)
          Processes thrown events
 void traverse(org.w3c.dom.Node ast)
          Performs a DFS traversal of the tree rooted at the given node.
 boolean TTSPaused()
          get current state of tts ie if it is paused or not
 void unloadVxmlLeafContext()
          Used to unload the root context for leaf documents.
 void update(java.util.Observable o, java.lang.Object arg)
          This method is called whenever the observed object is changed.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VXML_VERSION

static final java.lang.String VXML_VERSION
See Also:
Constant Field Values

EVENTS_PATH

static final java.lang.String EVENTS_PATH
See Also:
Constant Field Values

LOGGER_SETTINGS

static final java.lang.String LOGGER_SETTINGS
See Also:
Constant Field Values

DOM_PARSER_IMP

static final java.lang.String DOM_PARSER_IMP
See Also:
Constant Field Values

currentApplicationFile

java.lang.String currentApplicationFile

synth

static javax.speech.synthesis.Synthesizer synth

synthProp

javax.speech.synthesis.SynthesizerProperties synthProp

voices

javax.speech.synthesis.Voice[] voices

cepstral_voices

javax.speech.synthesis.Voice[] cepstral_voices

names

java.lang.String[] names

currVoice

int currVoice

TTS_LOUDEST

static float TTS_LOUDEST

TTS_QUIETEST

static float TTS_QUIETEST

TTS_VOLUME_CHANGE

static float TTS_VOLUME_CHANGE

TTS_FASTEST

static int TTS_FASTEST

TTS_SLOWEST

static int TTS_SLOWEST

CEPSTRAL_SLOWEST

static int CEPSTRAL_SLOWEST

TTS_RATE_CHANGE

static int TTS_RATE_CHANGE

TTS_HIGHEST

static int TTS_HIGHEST

TTS_LOWEST

static int TTS_LOWEST

TTS_PITCH_CHANGE

static int TTS_PITCH_CHANGE

registerEngine

public java.lang.String registerEngine

str

public java.lang.StringBuffer str

curEngine

public int curEngine

cepstral_index

public int cepstral_index

tts_index

public int tts_index

returnSubdialog

java.util.Map<java.lang.String,java.lang.Object> returnSubdialog

BREAK_DEFAULT

static final int BREAK_DEFAULT
See Also:
Constant Field Values

BREAK_NONE

static final int BREAK_NONE
See Also:
Constant Field Values

BREAK_SMALL

static final int BREAK_SMALL
See Also:
Constant Field Values

BREAK_MEDIUM

static final int BREAK_MEDIUM
See Also:
Constant Field Values

BREAK_LARGE

static final int BREAK_LARGE
See Also:
Constant Field Values

colorCombos

java.lang.String[][] colorCombos

counter

int counter
Constructor Detail

Processor

public Processor()
The only Constructor of this class. 1) initializes XML DOM parser (Xerces implementation) 2) Loads default events

Method Detail

allocateVoice

public void allocateVoice()
Allocates voice resources


deAllocateVoice

public void deAllocateVoice()
Deallocates Voice Resources


rangeSettings

public void rangeSettings()

stopAudioPlayer

public void stopAudioPlayer()
Closes the audio player


ParseText

public org.w3c.dom.Document ParseText(java.lang.String vxmlIn)
Parses the given string as a VXML file.

Parameters:
vxmlIn - vxml file as a String
Returns:
the resulting DOM

ParseURI

public org.w3c.dom.Document ParseURI(java.lang.String vxml)
Fetches the LSInput object refered to by the vxml string and parses it.

Parameters:
vxml - a String that is the key to the LSInput object in the cache
Returns:
the resulting parsed Document object

addToCache

public void addToCache(java.lang.String key,
                       java.io.ByteArrayInputStream byteStream)
Adds the ByteArrayInputStream object into the cache mapped to the given key.

Parameters:
key - a String used to identify the InputStream. Usually name of the vxml file
stream - the byte stream of the vxml file

fetchFromCache

public org.w3c.dom.ls.LSInput fetchFromCache(java.lang.String key)
Fetches the ByteArrayInputStream object into the cache mapped to the given key and convertes it into LSInput

Parameters:
key - a String used to identify the InputStream. Usually name of the vxml file
Returns:
LSInput the object created from the ByteArrayInputStream

createInput

public org.w3c.dom.ls.LSInput createInput(java.lang.String pathname)
This method creates the LSInput object for those uri that are not present in the cache. It gets the ByteArrayInputStream of the file, adds it to the cache and also creates the LSInput from it.

Parameters:
pathname - pathname locating the file
Returns:
LSInput the object created from the file.

getByteStream

public java.io.ByteArrayInputStream getByteStream(java.lang.String pathname)
Creates a ByteArrayInput Stream for the given pathname. It first opens the file and extracts bytes from the file. It then creates a ByteArrayInputStream over the bytes.

Parameters:
pathname - the path of the file
Returns:
the resulting LSInput object

parse

public org.w3c.dom.Document parse(java.lang.String input)
Parses the given input string. The type of parsing depends on whether the variable inputModeURI is set or not.

Parameters:
input - could be a URI or the enitre file.
Returns:
the resulting DOM

traverse

public void traverse(org.w3c.dom.Node ast)
Performs a DFS traversal of the tree rooted at the given node.

Parameters:
ast - root of the tree.

Run

public java.util.Map Run(java.lang.String URI)
This method is the one that should be called by any external package that needs to run a vxml application.

Parameters:
URI - a string which contains the URI relative to the currentPath!
Returns:
variables returned after the execution of the application.

setPath

public void setPath(java.lang.String path)
Sets the current execution path. All paths will be resolved relative to this path.

Parameters:
path -

runURI

public void runURI(boolean subdialog)
Executes the vxml file. The URI that it is supposed to follow is NOT passed as a parameter to this function, but rather set as a data member of the class (gotoURI). URI can be relative, absolute, or not be provided (TODO:so far only in same DIR). URI can be appended with a dialog name e.g. file.vxml#dialog or just #dialog

Parameters:
subdialog - indicates whether or not to run as a subdialog.

unloadVxmlLeafContext

public void unloadVxmlLeafContext()
Used to unload the root context for leaf documents. This is not necessary for a root document because it can be just removed.


loadVxmlContext

public void loadVxmlContext(org.w3c.dom.Document doc,
                            java.lang.String name)
Creates the dialog table, creates a document level scope, and pushes events.

Parameters:
doc - the source DOM
name - the name of the application

buildDialogTable

public void buildDialogTable(org.w3c.dom.Document doc,
                             java.util.Map dialogTable)
This is a pre-processing step. It create symbol table of variables, vector table of forms. Ideally this should be done while parsing!

Parameters:
doc - source DOM
dialogTable - a Map into which is to be populated

initializeVars

public void initializeVars(org.w3c.dom.Node ast)
Given an AST, initializes all variables, NAMED form item variable, properties, and scripts.

Parameters:
ast - root node

nameUnnamedFormItem

public java.lang.String nameUnnamedFormItem(org.w3c.dom.Node ast)
Given an item AST, return the/a item name for it. If the name attribute is present, return it. If it does not exist create and assign a random item name to it.

Parameters:
ast - the AST node
Returns:
name of the node

runDialog

public void runDialog(org.w3c.dom.Node ast)
Runs the handler that corresponds to the correct dialog.

Parameters:
ast - AST node

iForm

public void iForm(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iMenu

public void iMenu(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iField

public void iField(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iRecord

public void iRecord(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iTransfer

public void iTransfer(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iSubdialog

public void iSubdialog(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iObject

public void iObject(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iBlock

public void iBlock(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iInitial

public void iInitial(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iAudio

public void iAudio(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iFilled

public void iFilled(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iEmphasis

public void iEmphasis(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iUserinput

public void iUserinput()
Implementation of the element. It is not a standard VoiceXML element but has been introduced by us to make the interpreter wait for input from user.


iGrammar

public void iGrammar(org.w3c.dom.Node ast)
Implementation of the element. TODO: implementation will be changed soon.

Parameters:
ast - AST node

iOneOf

public void iOneOf(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iP

public void iP(org.w3c.dom.Node ast)
Implementation of the

element. Same as .

Parameters:
ast - AST node

iParagraph

public void iParagraph(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iPrompt

public void iPrompt(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iRuleRef

public void iRuleRef(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iS

public void iS(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iSentence

public void iSentence(org.w3c.dom.Node ast)
Implementation of the element. Same as .

Parameters:
ast - AST node

iVoice

public void iVoice(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iVxml

public void iVxml(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iAssign

public void iAssign(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iBreak

public void iBreak(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iClear

public void iClear(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iData

public void iData(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iDisconnect

public void iDisconnect(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iIf

public void iIf(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iElse

public void iElse(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iElseif

public void iElseif(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iExample

public void iExample(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iExit

public void iExit(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iGoto

public void iGoto(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iMark

public void iMark(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iMeta

public void iMeta(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iMetadata

public void iMetadata(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iOption

public void iOption(org.w3c.dom.Node ast)
Implementation of the
Parameters:
ast - AST node

iPhoneme

public void iPhoneme(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iProperty

public void iProperty(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iReprompt

public void iReprompt(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iReturn

public void iReturn(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iScript

public void iScript(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iSub

public void iSub(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iSubmit

public void iSubmit(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iTag

public void iTag(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iText

public java.lang.String iText(org.w3c.dom.Node ast)
Implementation of the element. This one is implicit - had to be created to handle mixed text/tags.

Parameters:
ast - AST node

iThrow

public void iThrow(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iToken

public void iToken(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iValue

public java.lang.String iValue(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iVar

public void iVar(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

iLog

public void iLog(org.w3c.dom.Node ast)
Implementation of the element.

Parameters:
ast - AST node

getEventList

public java.lang.String[] getEventList(org.w3c.dom.Node ast)
Returns a String array of event names

Parameters:
ast - the event node
Returns:
the array of event names

throwEvent

public void throwEvent(java.lang.String event,
                       java.lang.String message)
Processes thrown events

Parameters:
event -
message -

chooseAppropriateHandler

public org.w3c.dom.Node chooseAppropriateHandler(java.lang.String event)
Finds the appropriate handler for the event.

Parameters:
event - The event to look for
Returns:
the Node corresponding to the event

loadDefaultEvents

public void loadDefaultEvents(java.io.File dir)
Load default events - recursively process folder takes File structure to the directory, and the path to the directory

Parameters:
File - the directory to load the events from

pushEvents

public void pushEvents(ApplicationContext context,
                       org.w3c.dom.Node ast)
Creates new event scope, takes the ApplicationContext and event handler

Parameters:
context - Application context into which to push events
ast - Event to push

inputFromURI

public void inputFromURI(boolean mode)
Set file or text input - default is true - TEXT

Parameters:
mode -

input

public void input()
Tries to get a message from the queue.


output

public void output(java.lang.String txt)
Output line

Parameters:
txt -

outputText

public void outputText(java.lang.String txt)
Method to read out the text if it is not empty.

Parameters:
txt - Text to be read out

processIO

public void processIO()
Process Input queue


resumeTTS

public void resumeTTS()
resumes TTS


TTSPaused

public boolean TTSPaused()
get current state of tts ie if it is paused or not


pauseTTS

public void pauseTTS()
pauses TTS


runHandler

public void runHandler(java.lang.String handler)
Execute Hardcoded Handlers

Parameters:
handler -

changeColor

public void changeColor()
this function changes forgroung and background color


restartUtterance

public void restartUtterance()
restart Current Utterance


skipUtterance

public void skipUtterance()
Skip Current Utterance


stopAndExit

public void stopAndExit()
Stops tts and player and sets state to exit


getTTS_pitch

public float getTTS_pitch()
Used to get current pitch

Returns:
tts_pitch value

getTTS_rate

public float getTTS_rate()
Used to get current rate

Returns:
tts_rate value

getTTS_volume

public float getTTS_volume()
Used to get current volume

Returns:
tts_volume value

getCurrVoice

public int getCurrVoice()
Used to get current voice

Returns:
index of current voice

getCurrEngine

public int getCurrEngine()
returns current TTS engine

Returns:

setCurrVoice

public void setCurrVoice(int currVoice)
Used to change current voice.

Parameters:
currVoice - index of the required voice

setCurrEngine

public void setCurrEngine(int currEngine)

setTTS_pitch

public void setTTS_pitch(float tts_pitch)
Used to change current pitch

Parameters:
tts_pitch - value to set pitch to

setTTS_rate

public void setTTS_rate(float tts_rate)
Used to change current rate

Parameters:
tts_rate - value to set rate to

setTTS_volume

public void setTTS_volume(float tts_volume)
Used to change current volume

Parameters:
tts_volume - value to set volume to

setAppl

public void setAppl(CleanExit appl)

setDiskAccess

public void setDiskAccess(boolean disk_access)
this function tells sets variable indicating weather vxml file should be read from disk or in-memory data structure.


getDiskAccess

public boolean getDiskAccess()
this function tells us weather vxml file should be read from disk or in-memory data structure

Returns:
boolean

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
This method is called whenever the observed object is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change. Currently Hearsay is enable to notify.

Specified by:
update in interface java.util.Observer
Parameters:
o - - the observable object.
arg - - an argument passed by the notifyObservers method.

run

public void run()
Runnable run method implementation Execute the required task and go to wait.

Specified by:
run in interface java.lang.Runnable

terminate

public void terminate()
This function is called for clean exit


startVoiceRecognizer

public void startVoiceRecognizer()
This function is called to start the voice recognizer