How to add MaryTTS Voice (Jar File) to my own jar/load from folder in IntelliJ

大兔子大兔子 提交于 2021-01-29 02:42:48

问题


So I am probably just stupid but I am unable to get MaryTTS (which I just ship with my jar) to load a voice jar file/include it in my own jar and then load it automatically. How can I do this with IntelliJ properly?

I have tried extracting the voice into my jar, adding it as a jar file, creating a lib/voices folder inside my jar file's root folder etc. and I can't get it to work.

My code looks like this:

LocalMaryInterface marytts = new LocalMaryInterface();
System.out.println("Voices: ");
for(Voice voice : Voice.getAvailableVoices()) {
    System.out.println(voice.getName());
}

marytts.setVoice("dfki-prudence-hsmm"); //Causes Voice not exist error

Basically my code just prints "Voices:" and apperently there are non. I have the jar file of the voice but I am just unable to get it recognized by MaryTTS. Does anyone has an idea on how to do it with IntelliJ and where I need to put the jar?

来源:https://stackoverflow.com/questions/55766835/how-to-add-marytts-voice-jar-file-to-my-own-jar-load-from-folder-in-intellij

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!