簡體   English   中英

使用Java使用女性語音進行文字轉語音

[英]Text to speech with female voice using 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();}

如何將我的密碼更改為女性的聲音。 幫我!

閱讀文檔 ,我看到:

FreeTTS的該版本包括:

  • 核心語音合成引擎
  • 支持多種聲音:
    • 8khz雙音位, ,美國英語語音
    • 16khz雙音位,美國英語男聲
    • 16khz有限域​​,美國英語男聲
  • 支持從FestVox導入語音(僅美國英語)
  • 從FestVox導入CMU ARCTIC語音的特定支持(僅美國英語)
  • 支持MBROLA語音(單獨下載):
    • 16khz ,美國英語聲音
    • 兩個16khz美國男性英語聲音

因此,聽起來好像只帶有男性聲音。 也許如果您下載MBROLA聲音之一,您將獲得女性聲音。

另請參閱可用的聲音? ,它解釋了如何獲得女性聲音,但指出“ FreeTTS在Windows平台上不支持MBROLA”。

Voice voice = new Voice("kevin16", Voice.AGE_YOUNGER_ADULT,...

應該有其他選擇,凱文對我來說聽起來很男性。 嘗試Jane或其他方向

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM