import javax.speech.EngineList;
import javax.speech.EngineCreate;
import javax.speech.synthesis.SynthesizerModeDesc;
import javax.speech.synthesis.Synthesizer;
import com.sun.speech.freetts.jsapi.FreeTTSEngineCentral;
import java.util.Locale;
public class HelloWorld {
public static void main(String args[]) {
try {
// create SynthesizerModeDesc that will match the FreeTTS Synthesizer
SynthesizerModeDesc modeDesc = new SynthesizerModeDesc(
null,
"general", /* use "time" or "general" */
Locale.US,
Boolean.FALSE,
null);
if(modeDesc == null)
System.out.println("Error creating mode descriptor");
FreeTTSEngineCentral central = new FreeTTSEngineCentral();
Synthesizer synthesizer = null;
EngineList list = central.createEngineList(modeDesc);
if (list.size() > 0) {
EngineCreate creator = (EngineCreate) list.get(0);
synthesizer = (Synthesizer) creator.createEngine();
}
if (synthesizer == null) {
System.err.println("Cannot create synthesizer");
System.exit(1);
}
//get ready to speak
synthesizer.allocate();
synthesizer.resume();
// say hello world
synthesizer.speakPlainText("Hello, world!", null);
// wait until speaking is done and clean up
synthesizer.waitEngineState(Synthesizer.QUEUE_EMPTY);
synthesizer.deallocate();
} catch (Exception e) {
e.printStackTrace();
}
}
}
「システムプロパティ「mbrola.base」が未定義です。MBROLAボイスを使用しません。」のようなものが表示されます。だから私は何をすべきですか?私は何も聞くことができません。