upstream version 1.2.2
[debian/freetts] / tools / FestVoxToFreeTTS / BaseDiphoneTemplate.java.template
1 package %PATH%.%VOICENAME%;
2
3 import de.dfki.lt.freetts.DiphoneVoice;
4 import com.sun.speech.freetts.VoiceDirectory;
5 import com.sun.speech.freetts.Voice;
6 import com.sun.speech.freetts.Gender;
7 import com.sun.speech.freetts.Age;
8 import java.util.Locale;
9 import java.net.URL;
10
11
12 /**
13  * This voice directory provides a diphone voice imported
14  * from FestVox.
15  * This is designed to be a base-class handeling non-Us-English voices,
16  * the voice provided here is not a full TTS-voice.
17  */
18 public class %CLASSNAME% extends VoiceDirectory {
19     /**
20      * Gets the voices provided by this voice.
21      *
22      * @return an array of new Voice instances
23      */
24     public Voice[] getVoices() {
25
26         //if there is no phoneset.txt, this is null
27         URL phoneset = this.getClass().getResource("phoneset.txt");
28
29         // Change voice properties here
30         Voice voice = new DiphoneVoice("%NAME%",
31                 Gender.%GENDER%, Age.%AGE%, "%DESCRIPTION%",
32                 new Locale("%LOCALE%"), "%DOMAIN%", "%ORGANIZATION%",
33                 null,this.getClass().getResource("%VOICENAME%.bin"), 
34                 phoneset, null);
35         voice.setRate(150f);
36         voice.setPitch(200F);
37         voice.setPitchRange(12F);
38
39         Voice[] voices = {voice};
40         return voices;
41     }
42
43     /**
44      * Print out information about this voice jarfile.
45      */
46     public static void main(String[] args) {
47         System.out.println((new %CLASSNAME%()).toString());
48     }
49 }