问题
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