2
我想在我的項目中使用文本到語音實現,因爲我使用java-google文本語音API https://code.google.com/p/java-google-translate-text-to-speech/,但它只能識別多達100個字符。如果我給出了超過100個字符的長通道,它顯示錯誤。java文本到語音api
講話也應保存爲WAV或MP3文件
java.io.FileNotFoundException: http://translate.google.com/translate_tts?q=Some%20JVMs%20put%20restrictions%20on%20the%20total%20amount%20of%20memory%20available%20on%20the%20heap%20If%20you%20are%20getting%20to.%20Some%20JVMs%20put%20restrictions%20on%20the%20total%20amount%20of%20memory%20available%20on%20the%20heap%20If%20you%20are%20getting%20to&tl=en
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.gtranslate.Audio.getAudio(Audio.java:34)
at googl.STT.main(STT.java:25)
Exception in thread "main" java.lang.NullPointerException: in
at javazoom.jl.decoder.Bitstream.<init>(Unknown Source)
at javazoom.jl.player.Player.<init>(Unknown Source)
at javazoom.jl.player.Player.<init>(Unknown Source)
at com.gtranslate.Audio.play(Audio.java:39)
at googl.STT.main(STT.java:42)
有什麼辦法來糾正這一錯誤或建議我一個很好的開源文本到語音API,可以在Java
可用
爲什麼不把你的文本分成塊並分別傳入每個塊? – Floegipoky 2014-10-28 14:11:45
我想將音頻也保存爲wav或mp3文件。如果拆分成塊,將很難加入所有這些,這將是一項額外的工作。 – vignesh 2014-10-28 14:29:48
這裏是一個多語言的文本到語音[系統](https://github.com/marytts/marytts)。 – Luminous 2014-10-28 14:48:28