Marytts not outputting entire message or completly staying silent

29 Views Asked by At

So i started using marytts and it seems to work fine, but there is a bug that has been really consistent to which i havent found a solution. This is the code im using:

MaryInterface marytts = null;
try {
    marytts = new LocalMaryInterface();
} catch (MaryConfigurationException e3) {
    e3.printStackTrace();
}
marytts.setVoice(voice);
AudioInputStream audio = null;
try {
    audio = marytts.generateAudio(text);
} catch (SynthesisException e1) {
    e1.printStackTrace();
}
AudioPlayer player = new AudioPlayer(audio);
player.start();

The problem I'm facing is that sometimes the audio generated from text does not play at all or if text is long it will play only the last part of it and not the initial one. This happens when i first run the program but if i run it again in quick succession it will not have this bug. The problem will happen again if i wait a certain amount of time, the first time i run this code it will cut the message but the second one will be perfect. I'm guessing this has to do with the server being really slow setting up something and while this something is not set up the audio will not play causing the message to not play at all or once to this something is up and running will only play the remaining part of it. Did anyone encounter this problem and have a solution?

0

There are 0 best solutions below