|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable vxmlsurfer.Processor
public class Processor
This class controls the execution of the vxml file.
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 |
void |
iAudio(org.w3c.dom.Node ast)
Implementation of the |
void |
iBlock(org.w3c.dom.Node ast)
Implementation of the |
void |
iBreak(org.w3c.dom.Node ast)
Implementation of the |
void |
iClear(org.w3c.dom.Node ast)
Implementation of the |
void |
iData(org.w3c.dom.Node ast)
Implementation of the element. |
void |
iDisconnect(org.w3c.dom.Node ast)
Implementation of the |
void |
iElse(org.w3c.dom.Node ast)
Implementation of the |
void |
iElseif(org.w3c.dom.Node ast)
Implementation of the |
void |
iEmphasis(org.w3c.dom.Node ast)
Implementation of the |
void |
iExample(org.w3c.dom.Node ast)
Implementation of the |
void |
iExit(org.w3c.dom.Node ast)
Implementation of the |
void |
iField(org.w3c.dom.Node ast)
Implementation of the |
void |
iFilled(org.w3c.dom.Node ast)
Implementation of the |
void |
iForm(org.w3c.dom.Node ast)
Implementation of the |
void |
iGoto(org.w3c.dom.Node ast)
Implementation of the |
void |
iGrammar(org.w3c.dom.Node ast)
Implementation of the |
void |
iIf(org.w3c.dom.Node ast)
Implementation of the |
void |
iInitial(org.w3c.dom.Node ast)
Implementation of the |
void |
iLog(org.w3c.dom.Node ast)
Implementation of the |
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 |
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 |
void |
iOneOf(org.w3c.dom.Node ast)
Implementation of the |
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 |
void |
iPhoneme(org.w3c.dom.Node ast)
Implementation of the |
void |
iPrompt(org.w3c.dom.Node ast)
Implementation of the |
void |
iProperty(org.w3c.dom.Node ast)
Implementation of the |
void |
iRecord(org.w3c.dom.Node ast)
Implementation of the |
void |
iReprompt(org.w3c.dom.Node ast)
Implementation of the |
void |
iReturn(org.w3c.dom.Node ast)
Implementation of the |
void |
iRuleRef(org.w3c.dom.Node ast)
Implementation of the |
void |
iS(org.w3c.dom.Node ast)
Implementation of the |
void |
iScript(org.w3c.dom.Node ast)
Implementation of the |
void |
iSentence(org.w3c.dom.Node ast)
Implementation of the |
void |
iSub(org.w3c.dom.Node ast)
Implementation of the element. |
void |
iSubdialog(org.w3c.dom.Node ast)
Implementation of the |
void |
iSubmit(org.w3c.dom.Node ast)
Implementation of the |
void |
iTag(org.w3c.dom.Node ast)
Implementation of the |
java.lang.String |
iText(org.w3c.dom.Node ast)
Implementation of the |
void |
iThrow(org.w3c.dom.Node ast)
Implementation of the |
void |
iToken(org.w3c.dom.Node ast)
Implementation of the |
void |
iTransfer(org.w3c.dom.Node ast)
Implementation of the |
void |
iUserinput()
Implementation of the |
java.lang.String |
iValue(org.w3c.dom.Node ast)
Implementation of the |
void |
iVar(org.w3c.dom.Node ast)
Implementation of the element. |
void |
iVoice(org.w3c.dom.Node ast)
Implementation of the |
void |
iVxml(org.w3c.dom.Node ast)
Implementation of the |
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 |
---|
static final java.lang.String VXML_VERSION
static final java.lang.String EVENTS_PATH
static final java.lang.String LOGGER_SETTINGS
static final java.lang.String DOM_PARSER_IMP
java.lang.String currentApplicationFile
static javax.speech.synthesis.Synthesizer synth
javax.speech.synthesis.SynthesizerProperties synthProp
javax.speech.synthesis.Voice[] voices
javax.speech.synthesis.Voice[] cepstral_voices
java.lang.String[] names
int currVoice
static float TTS_LOUDEST
static float TTS_QUIETEST
static float TTS_VOLUME_CHANGE
static int TTS_FASTEST
static int TTS_SLOWEST
static int CEPSTRAL_SLOWEST
static int TTS_RATE_CHANGE
static int TTS_HIGHEST
static int TTS_LOWEST
static int TTS_PITCH_CHANGE
public java.lang.String registerEngine
public java.lang.StringBuffer str
public int curEngine
public int cepstral_index
public int tts_index
java.util.Map<java.lang.String,java.lang.Object> returnSubdialog
static final int BREAK_DEFAULT
static final int BREAK_NONE
static final int BREAK_SMALL
static final int BREAK_MEDIUM
static final int BREAK_LARGE
java.lang.String[][] colorCombos
int counter
Constructor Detail |
---|
public Processor()
Method Detail |
---|
public void allocateVoice()
public void deAllocateVoice()
public void rangeSettings()
public void stopAudioPlayer()
public org.w3c.dom.Document ParseText(java.lang.String vxmlIn)
vxmlIn
- vxml file as a String
public org.w3c.dom.Document ParseURI(java.lang.String vxml)
vxml
- a String that is the key to the LSInput object in the cache
public void addToCache(java.lang.String key, java.io.ByteArrayInputStream byteStream)
key
- a String used to identify the InputStream. Usually name of the
vxml filestream
- the byte stream of the vxml filepublic org.w3c.dom.ls.LSInput fetchFromCache(java.lang.String key)
key
- a String used to identify the InputStream. Usually name of the
vxml file
public org.w3c.dom.ls.LSInput createInput(java.lang.String pathname)
pathname
- pathname locating the file
public java.io.ByteArrayInputStream getByteStream(java.lang.String pathname)
pathname
- the path of the file
public org.w3c.dom.Document parse(java.lang.String input)
input
- could be a URI or the enitre file.
public void traverse(org.w3c.dom.Node ast)
ast
- root of the tree.public java.util.Map Run(java.lang.String URI)
URI
- a string which contains the URI relative to the currentPath!
public void setPath(java.lang.String path)
path
- public void runURI(boolean subdialog)
subdialog
- indicates whether or not to run as a subdialog.public void unloadVxmlLeafContext()
public void loadVxmlContext(org.w3c.dom.Document doc, java.lang.String name)
doc
- the source DOMname
- the name of the applicationpublic void buildDialogTable(org.w3c.dom.Document doc, java.util.Map dialogTable)
doc
- source DOMdialogTable
- a Map into which is to be populatedpublic void initializeVars(org.w3c.dom.Node ast)
ast
- root nodepublic java.lang.String nameUnnamedFormItem(org.w3c.dom.Node ast)
ast
- the AST node
public void runDialog(org.w3c.dom.Node ast)
ast
- AST nodepublic void iForm(org.w3c.dom.Node ast)
public void iMenu(org.w3c.dom.Node ast)
ast
- AST nodepublic void iField(org.w3c.dom.Node ast)
ast
- AST nodepublic void iRecord(org.w3c.dom.Node ast)
ast
- AST nodepublic void iTransfer(org.w3c.dom.Node ast)
ast
- AST nodepublic void iSubdialog(org.w3c.dom.Node ast)
ast
- AST nodepublic void iObject(org.w3c.dom.Node ast)
public void iBlock(org.w3c.dom.Node ast)
ast
- AST nodepublic void iInitial(org.w3c.dom.Node ast)
ast
- AST nodepublic void iAudio(org.w3c.dom.Node ast)
ast
- AST nodepublic void iFilled(org.w3c.dom.Node ast)
ast
- AST nodepublic void iEmphasis(org.w3c.dom.Node ast)
ast
- AST nodepublic void iUserinput()
public void iGrammar(org.w3c.dom.Node ast)
ast
- AST nodepublic void iOneOf(org.w3c.dom.Node ast)
ast
- AST nodepublic void iP(org.w3c.dom.Node ast)
element. Same as
ast
- AST node
public void iParagraph(org.w3c.dom.Node ast)
ast
- AST nodepublic void iPrompt(org.w3c.dom.Node ast)
ast
- AST nodepublic void iRuleRef(org.w3c.dom.Node ast)
ast
- AST nodepublic void iS(org.w3c.dom.Node ast)
ast
- AST nodepublic void iSentence(org.w3c.dom.Node ast)
ast
- AST nodepublic void iVoice(org.w3c.dom.Node ast)
ast
- AST nodepublic void iVxml(org.w3c.dom.Node ast)
ast
- AST nodepublic void iAssign(org.w3c.dom.Node ast)
ast
- AST nodepublic void iBreak(org.w3c.dom.Node ast)
ast
- AST nodepublic void iClear(org.w3c.dom.Node ast)
ast
- AST nodepublic void iData(org.w3c.dom.Node ast)
ast
- AST nodepublic void iDisconnect(org.w3c.dom.Node ast)
ast
- AST nodepublic void iIf(org.w3c.dom.Node ast)
ast
- AST nodepublic void iElse(org.w3c.dom.Node ast)
ast
- AST nodepublic void iElseif(org.w3c.dom.Node ast)
ast
- AST nodepublic void iExample(org.w3c.dom.Node ast)
ast
- AST nodepublic void iExit(org.w3c.dom.Node ast)
ast
- AST nodepublic void iGoto(org.w3c.dom.Node ast)
ast
- AST nodepublic void iMark(org.w3c.dom.Node ast)
ast
- AST nodepublic void iMeta(org.w3c.dom.Node ast)
ast
- AST nodepublic void iMetadata(org.w3c.dom.Node ast)
ast
- AST nodepublic void iOption(org.w3c.dom.Node ast)
public void iPhoneme(org.w3c.dom.Node ast)
ast
- AST nodepublic void iProperty(org.w3c.dom.Node ast)
ast
- AST nodepublic void iReprompt(org.w3c.dom.Node ast)
ast
- AST nodepublic void iReturn(org.w3c.dom.Node ast)
ast
- AST nodepublic void iScript(org.w3c.dom.Node ast)
public void iSub(org.w3c.dom.Node ast)
ast
- AST nodepublic void iSubmit(org.w3c.dom.Node ast)
ast
- AST nodepublic void iTag(org.w3c.dom.Node ast)
ast
- AST nodepublic java.lang.String iText(org.w3c.dom.Node ast)
ast
- AST nodepublic void iThrow(org.w3c.dom.Node ast)
ast
- AST nodepublic void iToken(org.w3c.dom.Node ast)
ast
- AST nodepublic java.lang.String iValue(org.w3c.dom.Node ast)
ast
- AST nodepublic void iVar(org.w3c.dom.Node ast)
ast
- AST nodepublic void iLog(org.w3c.dom.Node ast)
ast
- AST nodepublic java.lang.String[] getEventList(org.w3c.dom.Node ast)
ast
- the event node
public void throwEvent(java.lang.String event, java.lang.String message)
event
- message
- public org.w3c.dom.Node chooseAppropriateHandler(java.lang.String event)
event
- The event to look for
public void loadDefaultEvents(java.io.File dir)
File
- the directory to load the events frompublic void pushEvents(ApplicationContext context, org.w3c.dom.Node ast)
context
- Application context into which to push eventsast
- Event to pushpublic void inputFromURI(boolean mode)
mode
- public void input()
public void output(java.lang.String txt)
txt
- public void outputText(java.lang.String txt)
txt
- Text to be read outpublic void processIO()
public void resumeTTS()
public boolean TTSPaused()
public void pauseTTS()
public void runHandler(java.lang.String handler)
handler
- public void changeColor()
public void restartUtterance()
public void skipUtterance()
public void stopAndExit()
public float getTTS_pitch()
public float getTTS_rate()
public float getTTS_volume()
public int getCurrVoice()
public int getCurrEngine()
public void setCurrVoice(int currVoice)
currVoice
- index of the required voicepublic void setCurrEngine(int currEngine)
public void setTTS_pitch(float tts_pitch)
tts_pitch
- value to set pitch topublic void setTTS_rate(float tts_rate)
tts_rate
- value to set rate topublic void setTTS_volume(float tts_volume)
tts_volume
- value to set volume topublic void setAppl(CleanExit appl)
public void setDiskAccess(boolean disk_access)
public boolean getDiskAccess()
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
o
- - the observable object.arg
- - an argument passed by the notifyObservers method.public void run()
run
in interface java.lang.Runnable
public void terminate()
public void startVoiceRecognizer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |