Package com.sun.speech.freetts.jsapi

# Class FreeTTSSynthesizer

java.lang.Object
com.sun.speech.engine.BaseEngine
com.sun.speech.engine.synthesis.BaseSynthesizer
com.sun.speech.freetts.jsapi.FreeTTSSynthesizer

All Implemented Interfaces:
  `SpeechEventDispatcher`

public class FreeTTSSynthesizer extends BaseSynthesizer
Provides partial support for a JSAPI 1.0 synthesizer for the FreeTTS speech synthesis system.

## 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
`FreeTTSSynthesizer(FreeTTSSynthesizerModeDesc desc)`
Creates a new Synthesizer in the DEALLOCATED state.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`appendQueue(BaseSynthesizerQueueItem item)`
Places an item on the speaking queue and send the queue update 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 BaseEngineProperties`
`createEngineProperties()`
Factory constructor for EngineProperties object.
`protected BaseSynthesizerQueueItem`
`createQueueItem()`
Factory method to create a BaseSynthesizerQueueItem.
`Enumeration`
`enumerateQueue()`
Returns an enumeration of the queue.
`protected void`
`handleAllocate()`
Starts the output thread.
`protected void`
`handleDeallocate()`
Handles a deallocation request.
`protected void`
`handlePause()`
Pauses the output
`protected void`
`handleResume()`
Resumes the output

### Methods inherited from class com.sun.speech.engine.synthesis.BaseSynthesizer

`addSpeakableListener, 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

### FreeTTSSynthesizer

public FreeTTSSynthesizer(FreeTTSSynthesizerModeDesc desc)
Creates a new Synthesizer in the DEALLOCATED state.

Parameters:
  `desc` - describes the allowed mode of operations for this synthesizer.

## Method Details

### handleAllocate

protected void handleAllocate() throws EngineException
Starts the output thread. The output thread is responsible for taking items off of the queue and sending them to the audio player.

Specified by:
  `handleAllocate` in class `BaseEngine`
See Also:
  - `BaseEngine.allocate()`

### handleDeallocate

protected void handleDeallocate() throws EngineException
Handles a deallocation request. Cancels all pending items, terminates the output handler, and posts the state changes.

Specified by:
  `handleDeallocate` in class `BaseEngine`

### createQueueItem

protected BaseSynthesizerQueueItem createQueueItem()
Factory method to create a BaseSynthesizerQueueItem.

Overrides:
  `createQueueItem` in class `BaseSynthesizer`
Returns:
  a queue item appropriate for this synthesizer

### enumerateQueue

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

Specified by:
  `enumerateQueue` in class `BaseSynthesizer`
Returns:
  an enumeration of the contents of the queue. This enumeration contains FreeTTSSynthesizerQueueItem objects

### appendQueue

protected void appendQueue(BaseSynthesizerQueueItem item)
Places an item on the speaking queue and send the queue update event.

Specified by:
  `appendQueue` in class `BaseSynthesizer`
Parameters:
  `item` - the item to place in 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` - the object to cancel

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

### createEngineProperties

protected BaseEngineProperties createEngineProperties()
Factory constructor for EngineProperties object. Gets the default speaking voice from the SynthesizerModeDesc. Takes the default prosody values (pitch, range, volume, rate) from the default voice. Override to set engine-specific defaults.

Overrides:
  `createEngineProperties` in class `BaseSynthesizer`
Returns:
  a `BaseEngineProperties` object specific to a subclass.