当前位置: 首页>>代码示例>>Java>>正文


Java Utilities类代码示例

本文整理汇总了Java中com.sun.speech.freetts.util.Utilities的典型用法代码示例。如果您正苦于以下问题:Java Utilities类的具体用法?Java Utilities怎么用?Java Utilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Utilities类属于com.sun.speech.freetts.util包,在下文中一共展示了Utilities类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadVoice

import com.sun.speech.freetts.util.Utilities; //导入依赖的package包/类
public void loadVoice() {
    try {
        //File mbrola = new File(Info.PATH_DEVICES_FOLDER + "/freetts/data/voices/");
        //if ((mbrola.exists())) {
        //System.setProperty("mbrola.base", mbrola.getAbsolutePath().toString());
        //voice = VoiceManager.getInstance().getVoice(configuration.getProperty("mbrola-voice"));
        //} else {
        //use default basic voices
        System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
        voice = VoiceManager.getInstance().getVoice(Utilities.getProperty("voice16kName", "kevin16"));
        voice = VoiceManager.getInstance().getVoice("kevin16");
        //}
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice[] voices = voiceManager.getVoices();
        if (voices.length <= 0) {
            LOG.error("Cannot use text to speech, no voice found");
            setDescription("Cannot use text to speech, no voice found");
            stop();
        } else {
            voice.allocate();
        }
    } catch (Exception e) {
        LOG.error(Freedomotic.getStackTraceInfo(e));
    }
}
 
开发者ID:freedomotic,项目名称:freedomotic,代码行数:26,代码来源:TextToSpeech.java


注:本文中的com.sun.speech.freetts.util.Utilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。