我用java寫了文本到語音演示。雖然我爲此而努力,但是它並沒有和女性的聲音說話。使用java的女性語音的文本到語音
我的代碼是象下面這樣:
try {
System.setProperty("FreeTTSSynthEngineCentral",
"com.sun.speech.freetts.jsapi.FreeTTSEngineCentral");
System.setProperty("freetts.voices",
"com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
Central.registerEngineCentral("com.sun.speech.freetts.jsapi.FreeTTSEngineCentral");
SynthesizerModeDesc desc = new SynthesizerModeDesc(null, "general",
Locale.US, null, null);
Synthesizer synth = Central.createSynthesizer(desc);
synth.allocate();
desc = (SynthesizerModeDesc) synth.getEngineModeDesc();
Voice voice = new Voice("kevin16", Voice.AGE_YOUNGER_ADULT,
Voice.GENDER_FEMALE, null);
synth.getSynthesizerProperties().setVoice(voice);
synth.resume();
synth.speakPlainText(text, null);
synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
synth.deallocate(); }catch (Exception ex) {
ex.printStackTrace();}
將如何改變我的代碼了女性的聲音。幫我!
我想你是指文本到語音而不是語音到文本? – Henry
是的,我的意思是文本到語音。 –
@HeinMinnSoe請你成功實施女聲 – Abderrahim