|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alchar.jdtk.jsapi.DTKSynthesizer
public class DTKSynthesizer
This class implements a JSAPI 1.0 synthesizer for the DECtalk software speech synthesizer.
| Field Summary |
|---|
| Fields inherited from interface javax.speech.synthesis.Synthesizer |
|---|
QUEUE_EMPTY, QUEUE_NOT_EMPTY |
| Fields inherited from interface javax.speech.Engine |
|---|
ALLOCATED, ALLOCATING_RESOURCES, DEALLOCATED, DEALLOCATING_RESOURCES, PAUSED, RESUMED |
| Constructor Summary | |
|---|---|
DTKSynthesizer()
Create a new DTKSynthesizer object. |
|
DTKSynthesizer(DTKSynthesizerModeDesc modeDesc)
Create a new DTKSynthesizer object with the given synthesizer mode. |
|
| Method Summary | |
|---|---|
void |
addEngineListener(EngineListener listener)
Add an EngineListener to the listener list of this object. |
void |
addSpeakableListener(SpeakableListener listener)
Add a SpeakableListener to the listener list of this object. |
void |
allocate()
Allocate resources for the synthesizer. |
void |
cancel()
Remove the top-most item from the speech output queue. |
void |
cancel(Object obj)
Remove the given item from the speech output queue. |
void |
cancelAll()
Remove all items from the speech output queue, and terminate any item that is currently being spoken (if any). |
void |
deallocate()
Deallocate resources for the synthesizer. |
String |
describeState(long state)
Return a string representation for the given engine state. |
Enumeration |
enumerateQueue()
Return an enumeration of the items that are currently on the speech output queue. |
AudioManager |
getAudioManager()
Return the object that is responsible for managing the audio. |
EngineModeDesc |
getEngineModeDesc()
Return the mode description for the engine. |
EngineProperties |
getEngineProperties()
Return the engine properties object for this synthesizer. |
long |
getEngineState()
Return the engine state. |
SynthesizerProperties |
getSynthesizerProperties()
Return the synthesizer properties object for this synthesizer. |
VocabManager |
getVocabManager()
Return the object that is responsible for managing the vocabulary. |
void |
pause()
Pause the engine. |
String |
phoneme(String text)
Render the given plain text into a phoneme string. |
void |
removeEngineListener(EngineListener listener)
Remove an EngineListener from the listener list of this object. |
void |
removeSpeakableListener(SpeakableListener listener)
Remove a SpeakableListener from the listener list of this object. |
void |
resume()
Resume after previously pausing the engine. |
void |
sendAllocated(EngineEvent ev)
Send an engine allocated event. |
void |
sendAllocated(long[] states)
Send an engine allocated event. |
void |
sendAllocatingResources(EngineEvent ev)
Send an engine allocating resources event. |
void |
sendAllocatingResources(long[] states)
Send an engine allocating resources event. |
void |
sendDeallocated(EngineEvent ev)
Send an engine deallocated event. |
void |
sendDeallocated(long[] states)
Send an engine deallocated event. |
void |
sendDeallocatingResources(EngineEvent ev)
Send an engine deallocating resources event. |
void |
sendDeallocatingResources(long[] states)
Send an engine deallocating resources event. |
void |
sendPaused(EngineEvent ev)
Send an engine paused event. |
void |
sendPaused(long[] states)
Send an engine paused event. |
void |
sendQueueEmptied(boolean queueTopDiff,
long[] states)
Send a synthesizer queue emptied event. |
void |
sendQueueEmptied(SynthesizerEvent ev)
Send a synthesizer queue emptied event. |
void |
sendQueueUpdated(boolean queueTopDiff,
long[] states)
Send a synthesizer queue updated event. |
void |
sendQueueUpdated(SynthesizerEvent ev)
Send a synthesizer queue updated event. |
void |
sendResumed(EngineEvent ev)
Send an engine resumed event. |
void |
sendResumed(long[] states)
Send an engine resumed event. |
void |
speak(Speakable jsmlObj,
SpeakableListener listener)
Render the JSML text provided by the given Speakable object into speech. |
void |
speak(String jsmlText,
SpeakableListener listener)
Render the given JSML text into speech. |
void |
speak(URL jsmlURL,
SpeakableListener listener)
Render the JSML text found at the given URL into speech. |
void |
speakPlainText(String text,
SpeakableListener listener)
Render the given plain text into speech. |
boolean |
testEngineState(long state)
Return whether the current engine state matches the given state. |
void |
waitEngineState(long state)
Wait until the engine is in the specified state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DTKSynthesizer()
public DTKSynthesizer(DTKSynthesizerModeDesc modeDesc)
modeDesc - Synthesizer mode description| Method Detail |
|---|
public AudioManager getAudioManager()
getAudioManager in interface Enginepublic EngineModeDesc getEngineModeDesc()
getEngineModeDesc in interface EngineSecurityException - If not allowedpublic long getEngineState()
getEngineState in interface Engine
public VocabManager getVocabManager()
throws EngineStateError
getVocabManager in interface EngineEngineStateError - If deallocated or deallocatingpublic void addEngineListener(EngineListener listener)
addEngineListener in interface Enginelistener - Engine listenerpublic void removeEngineListener(EngineListener listener)
removeEngineListener in interface Enginelistener - Engine listenerpublic void addSpeakableListener(SpeakableListener listener)
addSpeakableListener in interface Synthesizerlistener - Speakable listenerpublic void removeSpeakableListener(SpeakableListener listener)
removeSpeakableListener in interface Synthesizerlistener - Speakable listener
public void allocate()
throws EngineException,
EngineStateError
An EngineStateError will be thrown if the engine is in the DEALLOCATING_RESOURCES state.
An EngineException will be thrown if the allocation fails.
allocate in interface EngineEngineException - If error
EngineStateError - If deallocating
public void deallocate()
throws EngineException,
EngineStateError
An EngineException will be thrown if the deallocation fails.
deallocate in interface EngineEngineException - If error
EngineStateError - If allocating
public void pause()
throws EngineStateError
pause in interface EngineEngineStateError - If deallocated or deallocating
public void resume()
throws EngineStateError
resume in interface EngineEngineStateError - If deallocated or deallocatingpublic String describeState(long state)
state - Engine state
public boolean testEngineState(long state)
throws IllegalArgumentException
testEngineState in interface Enginestate - Engine state
IllegalArgumentException - If wrong argument
public void waitEngineState(long state)
throws InterruptedException,
IllegalArgumentException
waitEngineState in interface Enginestate - Engine state
InterruptedException - If interrupted
IllegalArgumentException - If state is unreachable
public void cancelAll()
throws EngineStateError
cancelAll in interface SynthesizerEngineStateError - If deallocated or deallocating
public void cancel()
throws EngineStateError
cancel in interface SynthesizerEngineStateError - If deallocated or deallocating
public void cancel(Object obj)
throws EngineStateError
cancel in interface Synthesizerobj - Item to remove
EngineStateError - If deallocated or deallocating
public Enumeration enumerateQueue()
throws EngineStateError
enumerateQueue in interface SynthesizerEngineStateError - If deallocated or deallocatingpublic EngineProperties getEngineProperties()
getEngineProperties in interface Enginepublic SynthesizerProperties getSynthesizerProperties()
getSynthesizerProperties in interface Synthesizer
public String phoneme(String text)
throws EngineStateError
phoneme in interface Synthesizertext - Plain text
EngineStateError - If deallocated or deallocating
public void speakPlainText(String text,
SpeakableListener listener)
throws EngineStateError
speakPlainText in interface Synthesizertext - Plain textlistener - Speakable listener
EngineStateError - If deallocated or deallocating
public void speak(Speakable jsmlObj,
SpeakableListener listener)
throws JSMLException,
EngineStateError
speak in interface SynthesizerjsmlObj - Speakable objectlistener - Speakable listener
JSMLException - If JSML syntax errors
EngineStateError - If deallocated or deallocating
public void speak(URL jsmlURL,
SpeakableListener listener)
throws JSMLException,
MalformedURLException,
IOException,
EngineStateError
speak in interface SynthesizerjsmlURL - URL for JSML textlistener - Speakable listener
JSMLException - If JSML syntax errors
MalformedURLException - If URL syntax errors
IOException - If I/O errors
EngineStateError - If deallocated or deallocating
public void speak(String jsmlText,
SpeakableListener listener)
throws JSMLException,
EngineStateError
speak in interface SynthesizerjsmlText - JSML textlistener - Speakable listener
JSMLException - If JSML syntax errors
EngineStateError - If deallocated or deallocatingpublic void sendAllocated(EngineEvent ev)
ev - Engine eventpublic void sendAllocated(long[] states)
states - Array with old and new statepublic void sendAllocatingResources(EngineEvent ev)
ev - Engine eventpublic void sendAllocatingResources(long[] states)
states - Array with old and new statepublic void sendDeallocated(EngineEvent ev)
ev - Engine eventpublic void sendDeallocated(long[] states)
states - Array with old and new statepublic void sendDeallocatingResources(EngineEvent ev)
ev - Engine eventpublic void sendDeallocatingResources(long[] states)
states - Array with old and new statepublic void sendPaused(EngineEvent ev)
ev - Engine eventpublic void sendPaused(long[] states)
states - Array with old and new statepublic void sendResumed(EngineEvent ev)
ev - Engine eventpublic void sendResumed(long[] states)
states - Array with old and new statepublic void sendQueueEmptied(SynthesizerEvent ev)
ev - Synthesizer event
public void sendQueueEmptied(boolean queueTopDiff,
long[] states)
queueTopDiff - True if queue top changedstates - Array with old and new statepublic void sendQueueUpdated(SynthesizerEvent ev)
ev - Synthesizer event
public void sendQueueUpdated(boolean queueTopDiff,
long[] states)
queueTopDiff - True if queue top changedstates - Array with old and new state
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright © 2007-2009 Kris Van Hees. All Rights Reserved.