【问题标题】:mbrola issue while using freetts in java在 java 中使用 freetts 时出现 mbrola 问题
【发布时间】:2014-07-29 14:09:33
【问题描述】:

我使用以下代码使用 FreeTTs 和 Mbrola 创建语音。

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    Voice voice;
    VoiceManager vm = VoiceManager.getInstance();
    System.setProperty(“mbrola.base”, “C:\\mb\\”);
    voice=vm.getVoice(“mbrola_us3″);
    voice.allocate();
    voice.speak(“hello”);
    voice.deallocate();
}

我将所需文件保存在c:\mb,但收到以下异常:

Exception in thread “Thread-3″ java.lang.NoSuchMethodError: com.sun.speech.freetts.Voice.log(Ljava/lang/String;)V
at    de.dfki.lt.freetts.mbrola.MbrolaAudioOutput.processUtterance(MbrolaAudioOutput.java:58)
at com.sun.speech.freetts.Voice.runProcessor(Voice.java:595)
at com.sun.speech.freetts.Voice.outputUtterance(Voice.java:536)
at com.sun.speech.freetts.Voice.access$200(Voice.java:81)
at com.sun.speech.freetts.Voice$1.run(Voice.java:496)
BUILD STOPPED (total time: 1 minute 54 seconds)

你能帮我解决这个问题吗?

【问题讨论】:

    标签: java freetts mbrola


    【解决方案1】:

    NoSuchMethodError 在编译时表示该方法不存在或该方法不接受 String 参数。

    我认为它的这种方法 - voice.speak(“hello”); 是问题或更好,您可以使用 try .. catch 块并使用 e.toString() 获得问题结果

    【讨论】:

      猜你喜欢
      • 2011-01-30
      • 2014-12-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-17
      • 2011-05-22
      • 2013-12-05
      • 1970-01-01
      • 2012-10-07
      相关资源
      最近更新 更多