Archive for November, 2007

Creating a Subclass Again, (Crystaltech web hosting) you can create this

Friday, November 30th, 2007

Creating a Subclass Again, you can create this class with the Create a Java Class button. This time you not only enter the name of the new class, but you also press the Browse button at the right-hand side of the Superclass field. There, select the AudioOutput field from the list. Click Finish, and you can start to enter code. In the case of import statements and Javadoc comments, just proceed as discussed previously. When you enter the processUtterance() method, the Source > OverrideMethods context function will save you some work. In this function s dialog box mark the processUtterance() method below the AudioOutput class. Then you need only add the lines for calling the processUtterance() method from the Animator instance. Alternatively, you use the Code Assistant to create specific method stubs. For example, to create a stub for the processUtterance() method you need only type the letters pro and press Ctrl+Spacebar. Then select processUtterance from the list. After you have completed this class, you must tell FreeTTS to use AnimatedAudioOutput instead of AudioOutput. Which utterance processor is used for audio output is determined in the subclasses of the com.sun.speech.freetts.Voice class in the getAudioOutput() method. Since you plan to use the voice com.sun.speech.freetts.en.us.CMUDiphoneVoice for your application, you need to extend this class. For this purpose, create a new com.sun.speech.freetts.en.us package in the DukeSpeaks project. In this package create a new class named AnimatedDiphoneVoice. The AnimatedDiphoneVoice.java class When creating the AnimatedDiphoneVoice class, specify CMUDiphoneVoice as a super class and check the Constructors from Superclass option. In the generated constructor add the new animator parameter and store this parameter in an instance field. See Listing 5.4. package com.sun.speech.freetts.en.us; import java.io.IOException; import java.net.URL; import java.util.Locale; import com.sun.speech.freetts.Age; import com.sun.speech.freetts.Gender; import com.sun.speech.freetts.UtteranceProcessor; import com.sun.speech.freetts.relp.AnimatedAudioOutput; public class AnimatedDiphoneVoice extends CMUDiphoneVoice { UtteranceProcessor animator; /** * Constructor * @param name - the name of the voice * @param gender - the gender of the voice 82 Chapter 5 Listing 5.4 (Continues)
If hosting is cheap, it doesn’t need to be second-rate. Try us if you don’t believe cheap web hosting we have 30 days money back guarantee.

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

Thursday, November 29th, 2007

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.

Best web hosting site - /** * Method fireAnimationEvent. */ private void fireAnimationEvent()

Wednesday, November 28th, 2007

/** * Method fireAnimationEvent. */ private void fireAnimationEvent() { // If segment == null we have reached the end of the list if (segment != null) { // Fetch end time from segment and convert to msec int end = (int) (1000 * segment.getFeatures().getFloat(”end”)); // Get phoneme from segment String phone = segment.getFeatures().getString(”name”); // Advance in segment list segment = segment.getNext(); // Create new AnimationEvent object AnimationEvent e = new AnimationEvent(end, phone); // Send it to all AnimationListener objects Iterator iter = listeners.iterator(); while (iter.hasNext()) { AnimationListener listener = (AnimationListener) iter.next(); listener.processAnimationEvent(e); } // Create new timer that expires at the end time // of the current phoneme. timer = new Timer(end - currentTime, this); timer.setRepeats(false); timer.setCoalesce(false); timer.start(); // Update current time currentTime = end; } } update() The whole animation is started when a START line event arrives. The Animator receives such events because it is registered as a LineListener with the Java Sound System. /** * @see javax.sound.sampled.LineListener#update(LineEvent) */ public void update(LineEvent event) { if (event.getType().equals(LineEvent.Type.START)) { // Audio output has started start animation, too. // Fire first event fireAnimationEvent(); } } /** * @see java.lang.Object#toString() */ public String toString() { return “Animator”; } } 80 Chapter 5

Web hosting support - } /** * Method removeAnimationListener. * @param l

Tuesday, November 27th, 2007

} /** * Method removeAnimationListener. * @param l AnimationListener object */ public void removeAnimationListener(AnimationListener l) { listeners.remove(l); } processUtterance() Utterances produced by the speech engine are intercepted and processed in method processUtterance(). This method just resets the timer from a previous utterance and retrieves the first segment of the utterance. /** * @see com.sun.speech.freetts.UtteranceProcessor# * processUtterance(Utterance) */ public void processUtterance(Utterance utterance) throws ProcessException { // Reset current time currentTime = 0; // Stop time if it is still running (previous utterance) if (timer != null && timer.isRunning()) timer.stop(); // Fetch first segment of utterance segment = utterance.getRelation(Relation.SEGMENT).getHead(); } actionPerformed() When the timer expires, and animation event is posted to all registered listeners. /** * @see * java.awt.event.ActionListener#actionPerformed(ActionEvent) */ // Is executed when the timer expires public void actionPerformed(ActionEvent e) { // Fire event fireAnimationEvent(); } fireAnimationEvent() In this case, the end time of the utterance is fetched from the retrieved segment. An AnimationEvent object with this end time is created and posted to all registered listeners. Then a new timer object, which will expire at this end time, is created. 79 Project One: Duke Speaks
We are here to provide web hosting at an affordable rate for the online Christian community. The term “Christian” is used by various groups with diverse beliefs to describe themselves. Some people, including many born-again Christians, use a fairly specific definition of “Christian”. They believe that in order to be a Christian, one must follow Jesus, and that the proof of this is found in agreeing to and following the doctrines set forth in the Bible. Others who refer to themselves as Christians require only that one believes that Jesus is the Son of God, that he died, and that he was resurrected from the dead, to claim the term Christian.Check Christian Web Hosting section.

created with the Source > Add JavaDoc Comment (Java web server)

Monday, November 26th, 2007

created with the Source > Add JavaDoc Comment context function or by entering the string /** and pressing Enter. You complete these comments only as required. When entering method code you can use existing code templates: pri followed by Ctrl+Spacebar generates a stub for a private method; pub followed by Ctrl+Spacebar generates a stub for a public method. In addition, you don t have to spell out the names of types, methods, and fields. In most cases it is sufficient to type only a few letters and then call the Code Assistant by pressing Ctrl+Spacebar. The Animator.java Class The Animator class acts as a controller. Utterances processed by the speech engine are intercepted by the Animator who will produce animation events and post them to registered listeners. A timer object is used to produce the animation events at the correct moment. package com.sun.speech.freetts.relp; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.sound.sampled.LineEvent; import javax.sound.sampled.LineListener; import javax.swing.Timer; import com.sun.speech.freetts.*; public class Animator implements UtteranceProcessor, ActionListener, LineListener { // List of AnimationListener instances List listeners = new ArrayList(3); // Swing Timer object Timer timer; // Current segment in the segment list Item segment; // Start time of current segment int currentTime = 0; addAnimationListener() Listeners of type AnimationListener can register with the Animator via method addAnimationListener(). The Animator will post animation events to these listeners. /** * Method addAnimationListener. * @param l AnimationListener object */ public void addAnimationListener(AnimationListener l) { listeners.add(l); 78 Chapter 5
The UK has been a member of the European Union since 1973. The attitude of the present government towards further integration is conservative, with the official opposition favoring a return of some powers and competencies to the UK.From our experience, we can recommend Cheap UK Web Hosting services.

Follow these (Web site traffic) steps to create the interface: 1.

Sunday, November 25th, 2007

Follow these steps to create the interface: 1. Before creating the interface, you should complete the method code-generation template by adding the Method ${enclosing_method} headline.You can do so under Window > Preferences > Java> Code Style > Code Templates > Comments > Methods. 2. Press the Create a Java Interface button on the workbench s toolbar. Here, too, you can use the Source > Add JavaDoc Comment context function when entering comments. If you apply this function on the processAnimationEvent method, you only have to complete the text string after @param e. The Animator Now you can create the Animator class, which is also in the com.sun.speech.freetts .relp package. This class implements the com.sun.speech.freetts.UtteranceProcessor interface with the processUtterance() method. The Animator receives the Utterance instance it needs to process via this method. However, you cannot use this method to start animation, because the startup time needed by FreeTTS and the Java audio system would cause the animation to run ahead of the speech output. To keep the animation fully synchronous, you have to catch the START event of the audio system. For this purpose you also need to implement the javax.sound.sampled .LineListener interface with the update() method. After receiving the START event you can use your own timer to generate animation events. To react to the events of this timer, implement the additional java.awt.event.ActionListener interface with the actionPerformed() method. Once you have generated the animation events, pass them to all AnimationListener objects that have registered via the addAnimationListener() method. Creating a Class with Interfaces You can create this class, too, by clicking the Create a Java Class button, but this time you not only enter the name of the new class into the dialog, you also press the Add button to enter the names of the interfaces that this class is going to implement. Usually, it is sufficient to enter just a few characters to qualify the interface. You need to add the following interfaces: UtteranceProcessor, LineListener, and ActionListener. Then press the Finish button. Eclipse will now generate a class skeleton that includes all the methods declared in the specified interfaces: processUtterance(), update(), and actionPerformed(). However, this is done only if the Inherited Abstract Methods check box was marked. If you did not do this, you can easily fix the problem and create the new class by applying the Source > Override/Implement Methods context function. Actually, it didn t matter that you did not have access to the source code of the LineListener interface. Eclipse is able to retrieve the required information from the binary object. Eclipse decorates all generated method stubs with a TODO comment. These comments will show up in the Tasks window as entries and will thus remind you to complete the implementation of these methods. Using the Code Assistant When entering the code, you should not enter import statements and Javadoc comments at this time. Most of the import statements are automatically inserted by subsequently using the code assistant (Ctrl+Spacebar) anyway. After you have entered all the code, you can easily add any missing import statements by invoking the Source > Organize Imports context function. The Javadoc comments are 77 Project One: Duke Speaks
Our company is website hosting provider which offers web hosting services for php, java, mysql, frontpage, dreamweaver and domain name registration. Check more about us on website hosting provider part.

Web hosting asp - * @param endTime - the end time of

Saturday, November 24th, 2007

* @param endTime - the end time of the phoneme in msec * @param phone - the phoneme string */ public AnimationEvent(int endTime, String phone) { this.endTime = endTime; this.phone = phone; } } Listing 5.1 (Continued) Creating a New Class To create the AnimationEvent class, 1. Create the com.sun.speech.freetts.relp package in the DukeSpeaks project by pressing the Create a Java Package button on the workbench s toolbar. 2. Before creating new classes you should complete the code-generation template for constructors by adding the Constructor headline. You do this under Window > Preferences > Java > Code Style > Code Templates > Comments > Constructors. 3. After entering the package name and pressing Finish, create the new class AnimationEvent. To do so, click the Create a Java Class button on the workbench s toolbar. Enter the name of the class (AnimationEvent) and press the Finish button. 4. Start entering code. You don t have to enter much: you need only create the two fields endTime and phone, and you must modify the constructor as shown above. When creating comments you can make use of the Source > Add JavaDoc Comment context function. If you apply this function on the constructor, Eclipse will create a Javadoc comment in front of the constructor. (The same function can be invoked by entering the string /** in a new line in front of the constructor and then pressing the Enter key.) You only have to complete the text strings after @param endTime and after @param phone. Creating a New Interface Then you can create the AnimationListener interface in the same package. This one is also quite simple. Listing 5.2 shows the code for the AnimationListener.java interface. package com.sun.speech.freetts.relp; public interface AnimationListener { /** * Method processAnimationEvent. * @param e AnimationEvent object */ public void processAnimationEvent(AnimationEvent e); } Listing 5.2 76 Chapter 5
Thailand is divided into 75 provinces , which are gathered into 5 groups of provinces by location. There are also 2 special governed districts: the capital Bangkok and Pattaya. However Pattaya is still part of Chonburi Province. Some Thai people still count Bangkok as one province, making Thailand a 76-province country.All our thai web hosting accounts have spam filter, virus scanner and frontpage extensions preinstalled. Check more in Thai Web Hosting section.

10. In a further step, adjoining phonemes are (Web hosting packages)

Friday, November 23rd, 2007

10. In a further step, adjoining phonemes are combined into pairs (diphones). This allows a better resolution of the text into speech. 11. The PitchMark Generator analyzes the results of the contour generator and generates parameters for the later sound synthesis. 12. The results of the PitchMark Generator and the list of diphones are now used to select and concatenate the corresponding speech samples. 13. Finally, the concatenated samples are replayed with the help of a suitable audio player. FreeTTS is designed as a modular system. Each of the steps listed above is processed by a specialized Utterance Processor. An utterance is the basic data structure in FreeTTS. It may contain the complete text that is to be spoken but may later be broken into individual phrases, which again are represented as Utterance instances. Each utterance consists of a set of lists (in FreeTTS these are called relations). These include the lists of syllables, words, segments (results of the Segmenter), and so on. The various utterance processors perform read and write accesses to these lists. Detailed information about the architecture of FreeTTS is found in the FreeTTS Programmer s Guide (contained in the FreeTTS documentation). Extending the FreeTTS System You can derive the information needed for lip synchronization from the durations computed in step 8, where the duration of each single segment (phoneme) was determined. The best point for invoking the lip synchronization, however, is between steps 12 and 13, as close as possible to the audio output. You can generate the events for lip synchronization by implementing your own utterance processor, called Animator. This processor derives events (AnimationEvent) from the end times stored in each segment and sends these events to an AnimationListener at the right time. You can control this with your own timer. Animation Events First, implement the AnimationEvent class and the AnimationListener interface. Both are stored in the com.sun.speech.freetts.relp package. Listing 5.1 shows the code for AnimationEvent.java. package com.sun.speech.freetts.relp; public class AnimationEvent { public int endTime; public String phone; /** * Constructor 75 Project One: Duke Speaks Listing 5.1 (Continues)
You need web hosting, easy to use web template and great support. What else could I ask for?All of our reseller accounts include free web hosting templates just check web hosting templates for more information.

First you create the new Java DukeSpeaks project (Apache web server for windows)

Thursday, November 22nd, 2007

First you create the new Java DukeSpeaks project in the usual way. Again, you need to modify the Java Build Path. This time, however, you don t add external JARs but open the Projects page and checkmark the FreeTTS project. This makes the resources of the FreeTTS project available to the DukeSpeaks project as well. This applies, too, to the external JARs that you added to the FreeTTS project. However, these JARs must be marked for export in the FreeTTS project. This is currently not the case. So you must once again edit the Java Build Path of the FreeTTS project. To do so, select the project in the Package Explorer, right-click, and select the Properties context function. In the dialog that appears, select the Java Build Path category. Then open the Order and Export page. There checkmark all FreeTTS JARs, thus making them available to all projects that build on the FreeTTS project. To avoid having the example files from Chapter 1 littering the Package Explorer, you should create a new working set. To do so, follow these steps: 1. Click the drop-down button (down-arrow) on the toolbar of the Package Explorer and choose the Select Working Set function. In the dialog that now appears, press the New button. 2. In the next dialog, select Java as the working set type and press the Next button. 3. Finally, enter dukeSpeaks as the name and checkmark the FreeTTS and DukeSpeaks projects. From now on, the Package Explorer displays only these two projects. By invoking the Deselect Working Set function you can restore the original state. A Short Excursion into Speech Synthesis Before you start extending the FreeTTS system, you should get acquainted with the basics of speech synthesis and with the architecture of the FreeTTS system. Speech synthesis works in several steps: 1. A Tokenizer breaks the text into syntactical units (tokens). In general, these are words and numbers, including the punctuation. 2. Some tokens, such as numbers, are converted into words. 3. A Phraser analyzes the word list and organizes it into phrases (sentences and para-sentences). Phrasing establishes the basis for the later decoration of the speech output with pauses and melody. 4. A Segmenter analyzes the words and with the help of a lexicon assigns a syllable structure to each word. 5. The Pause Generator inserts a pause in front of each phrase. 6. The Intonator analyzes the syllables and assigns an emphasis and a pitch to each syllable. 7. In a further step and depending on the voice used, some phonemes are replaced by others. 8. The duration for each phoneme is determined. 9. The Contour Generator assigns an envelope curve to each syllable. 74 Chapter 5
Get account with us and you will get completely access to our free web templates database with over 10.000 templates in it to build your website.Don’t wait, go and check free web templates.

Project One: Duke Speaks In this chapter (Florida web design) you

Wednesday, November 21st, 2007

Project One: Duke Speaks In this chapter you are going to implement your first major example project. You will learn how to base a new project on an existing project and how to modify and enhance features of the base project. During this task you will use many of the comfortable features of the Eclipse Java IDE. The example application is based on the FreeTTS speech synthesizer that I have already introduced in Chapter 4. There I implemented the project FreeTTS with a speaking HelloWorld program, which communicated with the synthesizer via the JSAPI interface. In this chapter you will develop a Swing GUI for FreeTTS. This GUI includes an animated face that moves its lips synchronously with the speech output. Of course, there is also a speech synthesizer manufactured by IBM (ViaVoice) that even comes as an Eclipse plug-in. The Voice Toolkit for WebSphere Studio runs under Eclipse, too, and cooperates with the WebSphere Voice Server SDK. For our purposes, however, FreeTTS is better suited, since it is an Open Source product and supports all platforms supported by Eclipse. Setting Up the Project To achieve good lip synchronization, it is necessary to have event notification for single phonemes. The JSAPI, however, supports event notification only at the word level, and this event notification is currently not supported by the FreeTTS JSAPI implementation. The only choice is not to use the JSAPI but to drive FreeTTS via its native API. In addition, you have to create events for each single phoneme. This requires that you modify the FreeTTS runtime system. Despite these modifications, you can still use the external FreeTTS JARs as a basis. Where necessary you can subclass the FreeTTS classes to apply your modification. These new classes are stored in packages that bear the same name as the parent class but are stored in our new project, DukeSpeaks. 5
File Transfer Protocol comes together with anonymous ftp access with every FTP Web Hosting account we offer today. Enjoy burs table ftp transfers together with fast FTP connection.