* @param age - the age of the (Php5 web hosting)
* @param age - the age of the voice * @param description - a human-readable string providing a * description that can be displayed to users. * @param locale - the locale of the voice * @param domain - the voice domain, e.g. general, time, wheather * @param organization the organization which created the voice * @param lexicon - the lexicon to load * @param database - a url to the unit database file for this voice * @param animator - the animator for lip synchronization */ public AnimatedDiphoneVoice(String name,Gender gender,Age age, String description, Locale locale, String domain, String organization, CMULexicon lexicon, URL database, UtteranceProcessor animator) { super(name, gender, age, description, locale, domain, organization, lexicon, database); this.animator = animator; } /** * @see com.sun.speech.freetts.Voice#getAudioOutput() */ protected UtteranceProcessor getAudioOutput() throws IOException { return new AnimatedAudioOutput(animator); } } Listing 5.4 (Continued) Because you want this class to create an AnimatedAudioOutput, you must override the getAudioOutput() method. Here, too, you can make use of the Source > Override Methods context function. In the dialog that appears, mark the getAudioOutput() method below the CMUVoice class. Then, just complete the method as shown above. Connection with the Java Audio System What is still missing is the program logic for starting the animator. Here, you must first register the Animator as LineListener with a javax.sound.sampled.Line object. Such an object is created by the com.sun.speech.freetts.audio.JavaClipAudioPlayer player in the end() method in the disguise of a javax.sound.sampled.Clip object. The correct way to extend JavaClipAudioPlayer would be to subclass it. But unfortunately JavaClipAudioPlayer proves to be a stubborn beast. Too many private fields prevent us from applying the required extensions. Therefore, choose a different path. Simply create a copy of JavaClipAudioPlayer, which you then can modify easily. Theoretically, you could use the Copy function of the Package Explorer, but unfortunately this function cannot be applied to the contents of external JARs. Therefore, you must first create the new com.sun.speech.freetts.audio package in the DukeSpeaks project and create in this package the new AnimatedAudioPlayer class. Then open the JavaClipAudioPlayer class in the FreeTTS package, select the whole text (Ctrl+A), and copy it (Ctrl+C) to the clipboard. Then select the whole text in the new AnimatedAudioPlayer class and 83 Project One: Duke Speaks
We are the the largest streaming host company, and we provide professional audio & video web hosting streaming using Real Networks, QuickTime, Flash and Windows Media.We strongly recommend you to visit and check web hosting streaming services.