Embedding into FreeTTS Because you want to position (Php5 hosting)

Embedding into FreeTTS Because you want to position the animator as close as possible to the audio output, you need to call it from the AudioOutput utterance processor. Of course, you don t want to modify the existing AudioOutput class. Therefore, create a subclass of this class and override the processUtterance() method. Please note the little up-arrow appearing to the left beneath this method. It indicates that this method overrides an inherited definition. By hovering with the mouse above the arrow you can display further information about what was overridden, and by clicking the arrow you can navigate to the overridden version, too. The AnimatedAudioOutput.java class Listing 5.3 shows the code of the AnimatedAudioOutput class. Please note the call to the Animator in method processUtterance(). package com.sun.speech.freetts.relp; import com.sun.speech.freetts.ProcessException; import com.sun.speech.freetts.Utterance; import com.sun.speech.freetts.UtteranceProcessor; public class AnimatedAudioOutput extends AudioOutput { UtteranceProcessor animator; /** * Method AnimatedAudioOutput. * @param animator Animator object for generating animation events */ public AnimatedAudioOutput(UtteranceProcessor animator) { // Initialize animator field this.animator = animator; } /** * @see com.sun.speech.freetts.UtteranceProcessor# * processUtterance(Utterance) */ public void processUtterance(Utterance u) throws ProcessException { // In case we got an Animator we invoke its // processUtterance method. if (animator != null) animator.processUtterance(u); // Then proceed as usual super.processUtterance(u); } } Listing 5.3 81 Project One: Duke Speaks
If you need complete web hosting solution you come to right place,try mac web hosting services.

Leave a Reply