com.sun.speech.engine.synthesis.text
public class TextSynthesizer extends BaseSynthesizer
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.Modifier and Type | Class and Description |
---|---|
class |
TextSynthesizer.OutputHandler
The output device for a
TextSynthesizer . |
speakableListeners, voiceList
audioManager, CLEAR_ALL_STATE, engineListeners, engineModeDesc, engineProperties, engineState, engineStateLock
Constructor and Description |
---|
TextSynthesizer(SynthesizerModeDesc desc)
Creates a new Synthesizer in the DEALLOCATED state.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendQueue(BaseSynthesizerQueueItem item)
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 |
cancel(java.lang.Object source)
Cancels a specific object on the queue.
|
void |
cancelAll()
Cancels all items on the output queue.
|
protected BaseSynthesizerQueueItem |
createQueueItem()
Creates a TextSynthesizerQueueItem.
|
java.util.Enumeration |
enumerateQueue()
Returns an enumeration of the queue.
|
protected void |
handleAllocate()
Starts the output thread.
|
protected void |
handleDeallocate()
Stops the output thread.
|
protected void |
handlePause()
Pauses the output.
|
protected void |
handleResume()
Resumes the output.
|
addSpeakableListener, createEngineProperties, dispatchSpeechEvent, fireQueueEmptied, fireQueueUpdated, getSynthesizerProperties, getVoiceList, phoneme, postQueueEmptied, postQueueUpdated, removeSpeakableListener, speak, speak, speak, speakPlainText, stateToString
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
public TextSynthesizer(SynthesizerModeDesc desc)
desc
- the operating modeprotected void handleAllocate()
handleAllocate
in class BaseEngine
BaseEngine.allocate()
protected void handleDeallocate()
handleDeallocate
in class BaseEngine
protected BaseSynthesizerQueueItem createQueueItem()
createQueueItem
in class BaseSynthesizer
public java.util.Enumeration enumerateQueue() throws EngineStateError
enumerateQueue
in class BaseSynthesizer
Enumeration
of the speech output queue or
null
.EngineStateError
- if this Synthesizer
in the DEALLOCATED
or
DEALLOCATING_RESOURCES
statesprotected void appendQueue(BaseSynthesizerQueueItem item)
TextSynthesizerQueueItems
.appendQueue
in class BaseSynthesizer
item
- the item to add to the queuepublic void cancel() throws EngineStateError
cancel
in class BaseSynthesizer
EngineStateError
- if this Synthesizer
in the DEALLOCATED
or
DEALLOCATING_RESOURCES
statespublic void cancel(java.lang.Object source) throws java.lang.IllegalArgumentException, EngineStateError
cancel
in class BaseSynthesizer
source
- object to be removed from the speech output queuejava.lang.IllegalArgumentException
- if the source object is not found in the speech output queue.EngineStateError
- if this Synthesizer
in the DEALLOCATED
or
DEALLOCATING_RESOURCES
statespublic void cancelAll() throws EngineStateError
cancelAll
in class BaseSynthesizer
EngineStateError
- if this Synthesizer
in the DEALLOCATED
or
DEALLOCATING_RESOURCES
statesprotected void handlePause()
handlePause
in class BaseEngine
protected void handleResume()
handleResume
in class BaseEngine