Class 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.
    • Constructor Detail

      • 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 Detail

      • 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
        Throws:
        EngineException - if an allocation error occurs
        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
        Throws:
        EngineException - if a deallocation error occurs
      • enumerateQueue

        public java.util.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
        Throws:
        EngineStateError - if the engine was not in the proper state
      • 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
        Throws:
        EngineStateError - if the synthesizer is not in the proper state
      • cancel

        public void cancel​(java.lang.Object source)
                    throws java.lang.IllegalArgumentException,
                           EngineStateError
        Cancels a specific object on the queue.
        Specified by:
        cancel in class BaseSynthesizer
        Parameters:
        source - the object to cancel
        Throws:
        java.lang.IllegalArgumentException - if the source object is not currently in the queue
        EngineStateError - the synthesizer is not in the proper state
      • cancelAll

        public void cancelAll()
                       throws EngineStateError
        Cancels all items on the output queue.
        Specified by:
        cancelAll in class BaseSynthesizer
        Throws:
        EngineStateError
      • 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.