【发布时间】:2011-04-27 22:19:43
【问题描述】:
我收到以下错误:
系统属性“mbrola.base”未定义。不会使用 MBROLA 声音。import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;
public class HelloWorld
{
public static void main(String args[])
{
try
{
// Create a synthesizer for English
Synthesizer synth = Central.createSynthesizer(
new SynthesizerModeDesc(Locale.ENGLISH));
// Get it ready to speak
synth.allocate();
synth.resume();
// Speak the “Hello world” string
synth.speakPlainText("Hello", null);
// Wait till speaking is done
synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
// Clean up
synth.deallocate();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
【问题讨论】:
-
@user481404 - 仅供参考,带有 1 和 0 的按钮有助于正确格式化您在问题中输入的任何代码。
-
@user481404 - 此外,使用大写字母通常被认为是粗鲁的!
标签: text-to-speech jsapi