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
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, voiceListFields inherited from class com.sun.speech.engine.BaseEngine
audioManager, CLEAR_ALL_STATE, engineListeners, engineModeDesc, engineProperties, engineState, engineStateLock -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Synthesizer in the DEALLOCATED state. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPlaces an item on the speaking queue and send the queue update 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 BaseEnginePropertiesFactory constructor for EngineProperties object.protected BaseSynthesizerQueueItemFactory method to create a BaseSynthesizerQueueItem.Returns an enumeration of the queue.protected voidStarts the output thread.protected voidHandles a deallocation request.protected voidPauses the outputprotected voidResumes the outputMethods inherited from class com.sun.speech.engine.synthesis.BaseSynthesizer
addSpeakableListener, 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
-
FreeTTSSynthesizer
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 EngineExceptionStarts the output thread. The output thread is responsible for taking items off of the queue and sending them to the audio player.- Specified by:
handleAllocatein classBaseEngine- See Also:
-
handleDeallocate
protected void handleDeallocate() throws EngineExceptionHandles a deallocation request. Cancels all pending items, terminates the output handler, and posts the state changes.- Specified by:
handleDeallocatein classBaseEngine
-
createQueueItem
Factory method to create a BaseSynthesizerQueueItem.- Overrides:
createQueueItemin classBaseSynthesizer- Returns:
- a queue item appropriate for this synthesizer
-
enumerateQueue
Returns an enumeration of the queue.- Specified by:
enumerateQueuein classBaseSynthesizer- Returns:
- an enumeration of the contents of the queue. This enumeration contains FreeTTSSynthesizerQueueItem objects
-
appendQueue
Places an item on the speaking queue and send the queue update event.- Specified by:
appendQueuein classBaseSynthesizer- Parameters:
item- the item to place in 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- the object to cancel
-
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
-
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:
createEnginePropertiesin classBaseSynthesizer- Returns:
- a
BaseEnginePropertiesobject specific to a subclass.
-