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 TypeClassDescriptionclassThe output device for aTextSynthesizer. -
Field Summary
Fields inherited from class com.sun.speech.engine.synthesis.BaseSynthesizer
speakableListeners, voiceListFields 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 voidPuts an item on the speaking queue and sends a queue updated event.voidcancel()Cancels the item at the top of the queue.voidCancels a specific object on the queue.voidCancels all items on the output queue.protected BaseSynthesizerQueueItemCreates a TextSynthesizerQueueItem.Returns an enumeration of the queue.protected voidStarts the output thread.protected voidStops the output thread.protected voidPauses the output.protected voidResumes 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, stateToStringMethods 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:
handleAllocatein classBaseEngine- See Also:
-
handleDeallocate
protected void handleDeallocate()Stops the output thread.- Specified by:
handleDeallocatein classBaseEngine
-
createQueueItem
Creates a TextSynthesizerQueueItem.- Overrides:
createQueueItemin classBaseSynthesizer- Returns:
- a TextSynthesizerQueueItem
-
enumerateQueue
Returns an enumeration of the queue.- Specified by:
enumerateQueuein classBaseSynthesizer- Returns:
- an
Enumerationof the speech output queue ornull.
-
appendQueue
Puts an item on the speaking queue and sends a queue updated event. Expects onlyTextSynthesizerQueueItems.- Specified by:
appendQueuein 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:
cancelin classBaseSynthesizer
-
cancel
Cancels a specific object on the queue.- Specified by:
cancelin 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:
cancelAllin classBaseSynthesizer
-
handlePause
protected void handlePause()Pauses the output.- Specified by:
handlePausein classBaseEngine
-
handleResume
protected void handleResume()Resumes the output.- Specified by:
handleResumein classBaseEngine
-