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