Package com.sun.speech.engine.synthesis.text

# 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`

public class TextSynthesizer extends BaseSynthesizer
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 Classes
Modifier and Type
Class
Description
`class`
`TextSynthesizer.OutputHandler`
The output device for a `TextSynthesizer`.

## 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

Constructors
Constructor
Description
`TextSynthesizer(SynthesizerModeDesc desc)`
Creates a new Synthesizer in the DEALLOCATED state.

## Method Summary

Modifier and Type
Method
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(Object source)`
Cancels a specific object on the queue.
`void`
`cancelAll()`
Cancels all items on the output queue.
`protected BaseSynthesizerQueueItem`
`createQueueItem()`
Creates a TextSynthesizerQueueItem.
`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.

### 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## 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 class `BaseEngine`
See Also:
  - `BaseEngine.allocate()`

### handleDeallocate

protected void handleDeallocate()
Stops the output thread.

Specified by:
  `handleDeallocate` in class `BaseEngine`

### createQueueItem

protected BaseSynthesizerQueueItem createQueueItem()
Creates a TextSynthesizerQueueItem.

Overrides:
  `createQueueItem` in class `BaseSynthesizer`
Returns:
  a TextSynthesizerQueueItem

### enumerateQueue

public Enumeration enumerateQueue() throws EngineStateError
Returns an enumeration of the queue.

Specified by:
  `enumerateQueue` in class `BaseSynthesizer`
Returns:
  an `Enumeration` of the speech output queue or `null`.

### appendQueue

protected void appendQueue(BaseSynthesizerQueueItem item)
Puts an item on the speaking queue and sends a queue updated event. Expects only `TextSynthesizerQueueItems`.

Specified by:
  `appendQueue` in class `BaseSynthesizer`
Parameters:
  `item` - the item to add to the queue

### cancel

public void cancel() throws EngineStateError
Cancels the item at the top of the queue.

Specified by:
  `cancel` in class `BaseSynthesizer`

### cancel

public void cancel(Object source) throws IllegalArgumentException, EngineStateError
Cancels a specific object on the queue.

Specified by:
  `cancel` in class `BaseSynthesizer`
Parameters:
  `source` - object to be removed from the speech output queue

### cancelAll

public void cancelAll() throws EngineStateError
Cancels all items on the output queue.

Specified by:
  `cancelAll` in class `BaseSynthesizer`

### handlePause

protected void handlePause()
Pauses the output.

Specified by:
  `handlePause` in class `BaseEngine`

### handleResume

protected void handleResume()
Resumes the output.

Specified by:
  `handleResume` in class `BaseEngine`