I just want to use Freetts testing with this code but i got an error:
ClassCastException: class com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory cannot be cast to class com.sun.speech.freetts.VoiceDirectory (com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory is in unnamed module of loader com.sun.speech.freetts.DynamicClassLoader @23bc24e9; com.sun.speech.freetts.VoiceDirectory is in unnamed module of loader 'app')
What's the problem?
I already put libraries.
import com.sun.speech.freetts.VoiceManager;
public class Voice {
private String name;
private com.sun.speech.freetts.Voice voice;
public Voice(String name) {
this.name = name;
this.voice = VoiceManager.getInstance().getVoice(this.name);
this.voice.allocate();
}
public void say(String something) {
this.voice.speak(something);
}
public static void main(String[] args) {
Voice voice = new Voice("kevin16");
String say ="hi";
voice.say(say);
}
}