I have a java program in which I am using TTS (Text to speech), in there along with that I want an animated gif to come up on the screen. I am using Netbeans GUI builder, so I made up a new jpanel form
and added the gif
in a label in that form (java jpanel form), and after that I added this java as a jpanel to my main java file (by dragging and dropping). But the problem is that as soon as the TTS, starts to speak something it stops the animation of the gif. How to make it work together?
Note: I am using freeTTS for converting text to speech
Code:
private static final String VOICENAME = "kevin16";
VoiceManager voiceManager = VoiceManager.getInstance();
.....
........
Voice voice;
voice = voiceManager.getVoice(VOICENAME);
voice.allocate();
....//Some code here
t4.setText("" + ran);
voice.speak(t4.getText());
listenanum.setText("" + d);
listenanum.setVisible(false);