cmu_usclunittemplate.java.template

来自「使用Exlipse编写的一个语音程序」· TEMPLATE 代码 · 共 46 行

TEMPLATE
46
字号
package com.sun.speech.freetts.en.us.%VOICENAME%;import com.sun.speech.freetts.en.us.CMUTimeVoice;import com.sun.speech.freetts.en.us.CMULexicon;import com.sun.speech.freetts.VoiceDirectory;import com.sun.speech.freetts.Voice;import com.sun.speech.freetts.Gender;import com.sun.speech.freetts.Age;import java.util.Locale;/** * This voice directory provides a US/English Cluster Unit voice imported * from FestVox.  This is expressly written for the CMU Time voice, so * it will require editing if you are importing any other type of voice. */public class %CLASSNAME% extends VoiceDirectory {    /**     * Gets the voices provided by this voice.     *     * @return an array of new Voice instances     */    public Voice[] getVoices() {        // default to the generic lexicon        // (a more specific lexicon may increase performance)        CMULexicon lexicon = new CMULexicon("cmulex");        // Change voice properties here        Voice voice = new CMUTimeVoice("%NAME%",                Gender.%GENDER%, Age.%AGE%, "%DESCRIPTION%",                Locale.US, "%DOMAIN%", "%ORGANIZATION%",                lexicon,                this.getClass().getResource("%VOICENAME%.bin"));        Voice[] voices = {voice};        return voices;    }    /**     * Print out information about this voice jarfile.     */    public static void main(String[] args) {        System.out.println((new %CLASSNAME%()).toString());    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?