Class TextSynthesizer
java.lang.Object
com.sun.speech.engine.BaseEngine
com.sun.speech.engine.synthesis.BaseSynthesizer
com.sun.speech.engine.synthesis.text.TextSynthesizer
- All Implemented Interfaces:
SpeechEventDispatcher
Supports a simple text-output-only JSAPI 1.0
Synthesizer
.
Intended for demonstration purposes for those developing JSAPI
implementations. It may also be useful to developers who want a
JSAPI synthesizer that doesn't produce any noise.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
The output device for aTextSynthesizer
. -
Field Summary
Fields inherited from class com.sun.speech.engine.synthesis.BaseSynthesizer
speakableListeners, voiceList
Fields inherited from class com.sun.speech.engine.BaseEngine
audioManager, CLEAR_ALL_STATE, engineListeners, engineModeDesc, engineProperties, engineState, engineStateLock
-
Constructor Summary
ConstructorsConstructorDescriptionTextSynthesizer
(SynthesizerModeDesc desc) Creates a new Synthesizer in the DEALLOCATED state. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Puts an item on the speaking queue and sends a queue updated event.void
cancel()
Cancels the item at the top of the queue.void
Cancels a specific object on the queue.void
Cancels all items on the output queue.protected BaseSynthesizerQueueItem
Creates a TextSynthesizerQueueItem.Returns an enumeration of the queue.protected void
Starts the output thread.protected void
Stops the output thread.protected void
Pauses the output.protected void
Resumes the output.Methods inherited from class com.sun.speech.engine.synthesis.BaseSynthesizer
addSpeakableListener, createEngineProperties, dispatchSpeechEvent, fireQueueEmptied, fireQueueUpdated, getSynthesizerProperties, getVoiceList, phoneme, postQueueEmptied, postQueueUpdated, removeSpeakableListener, speak, speak, speak, speakPlainText, stateToString
Methods inherited from class com.sun.speech.engine.BaseEngine
addEngineListener, allocate, checkEngineState, deallocate, fireEngineAllocated, fireEngineAllocatingResources, fireEngineDeallocated, fireEngineDeallocatingResources, fireEnginePaused, fireEngineResumed, getAudioManager, getEngineModeDesc, getEngineProperties, getEngineState, getVocabManager, pause, postEngineAllocated, postEngineAllocatingResources, postEngineDeallocated, postEngineDeallocatingResources, postEnginePaused, postEngineResumed, removeEngineListener, resume, setEngineModeDesc, setEngineState, testEngineState, toString, waitEngineState
-
Constructor Details
-
TextSynthesizer
public TextSynthesizer(SynthesizerModeDesc desc) Creates a new Synthesizer in the DEALLOCATED state.- Parameters:
desc
- the operating mode
-
-
Method Details
-
handleAllocate
protected void handleAllocate()Starts the output thread.- Specified by:
handleAllocate
in classBaseEngine
- See Also:
-
handleDeallocate
protected void handleDeallocate()Stops the output thread.- Specified by:
handleDeallocate
in classBaseEngine
-
createQueueItem
Creates a TextSynthesizerQueueItem.- Overrides:
createQueueItem
in classBaseSynthesizer
- Returns:
- a TextSynthesizerQueueItem
-
enumerateQueue
Returns an enumeration of the queue.- Specified by:
enumerateQueue
in classBaseSynthesizer
- Returns:
- an
Enumeration
of the speech output queue ornull
.
-
appendQueue
Puts an item on the speaking queue and sends a queue updated event. Expects onlyTextSynthesizerQueueItems
.- Specified by:
appendQueue
in classBaseSynthesizer
- Parameters:
item
- the item to add to the queue
-
cancel
public void cancel() throws EngineStateErrorCancels the item at the top of the queue.- Specified by:
cancel
in classBaseSynthesizer
-
cancel
Cancels a specific object on the queue.- Specified by:
cancel
in classBaseSynthesizer
- Parameters:
source
- object to be removed from the speech output queue
-
cancelAll
public void cancelAll() throws EngineStateErrorCancels all items on the output queue.- Specified by:
cancelAll
in classBaseSynthesizer
-
handlePause
protected void handlePause()Pauses the output.- Specified by:
handlePause
in classBaseEngine
-
handleResume
protected void handleResume()Resumes the output.- Specified by:
handleResume
in classBaseEngine
-