public class FreeTTSSynthesizer extends BaseSynthesizer
Modifier and Type | Class and Description |
---|---|
(package private) class |
FreeTTSSynthesizer.FreeTTSSynthesizerProperties
Manages the FreeTTS synthesizer properties
|
(package private) class |
FreeTTSSynthesizer.OutputHandler
The OutputHandler is responsible for taking items off of the
input queue and sending them to the current voice.
|
Modifier and Type | Field and Description |
---|---|
private AudioPlayer |
audio |
private FreeTTSVoice |
curVoice
The currently active voice for this synthesizer
|
private static Logger |
LOGGER
Logger instance.
|
(package private) FreeTTSSynthesizer.OutputHandler |
outputHandler
Reference to output thread.
|
private OutputQueue |
outputQueue
All voice output for this synthesizer goes through
this central utterance queue
|
Constructor and Description |
---|
FreeTTSSynthesizer(FreeTTSSynthesizerModeDesc desc)
Creates a new Synthesizer in the DEALLOCATED state.
|
Modifier and Type | Method and 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
|
private boolean |
setCurrentVoice(FreeTTSVoice voice)
Sets the given voice to be the current voice.
|
FreeTTSSynthesizer.OutputHandler outputHandler
private FreeTTSVoice curVoice
private AudioPlayer audio
private OutputQueue outputQueue
public FreeTTSSynthesizer(FreeTTSSynthesizerModeDesc desc)
desc
- describes the allowed mode of operations for this
synthesizer.protected void handleAllocate() throws javax.speech.EngineException
javax.speech.EngineException
- if an allocation error occursprivate boolean setCurrentVoice(FreeTTSVoice voice) throws javax.speech.EngineException
voice
- the new voice.javax.speech.EngineException
protected void handleDeallocate() throws javax.speech.EngineException
javax.speech.EngineException
- if a deallocation error occursprotected BaseSynthesizerQueueItem createQueueItem()
public Enumeration enumerateQueue() throws javax.speech.EngineStateError
javax.speech.EngineStateError
- if the engine was not in the proper
stateprotected void appendQueue(BaseSynthesizerQueueItem item)
item
- the item to place in the queuepublic void cancel() throws javax.speech.EngineStateError
javax.speech.EngineStateError
- if the synthesizer is not in the
proper statepublic void cancel(Object source) throws IllegalArgumentException, javax.speech.EngineStateError
source
- the object to cancelIllegalArgumentException
- if the source object is not
currently in the queuejavax.speech.EngineStateError
- the synthesizer is not in the
proper statepublic void cancelAll() throws javax.speech.EngineStateError
javax.speech.EngineStateError
protected void handlePause()
protected void handleResume()
protected BaseEngineProperties createEngineProperties()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses