I am trying to implement a module which uses freetts to create a wave file with the text specified. The code runs fine on windows machine from eclipse, but when I try to execute the JAR on a linux device, it is always giving a NullPointerException. I tried on a couple of linux boxes, and I see consistent results.
This is the error I am getting:
voiceManager:
helloVoice: null
java.lang.NullPointerException
at test.VoiceGen.textToVoice(VoiceGen.java:31)
at test.MainClass.main(MainClass.java:9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Found out the issue. Basically cmu_us_kal.jar contains the voices which was not included in my libraries on the linux boxes. After adding this file and all the others in the lib directory of freetts, the code works as expected. When including the libraries don't just include the freetts.jar but all the others as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to implement a module which uses freetts to create a wave file with the text specified. The code runs fine on windows machine from eclipse, but when I try to execute the JAR on a linux device, it is always giving a NullPointerException. I tried on a couple of linux boxes, and I see consistent results.
This is the error I am getting:
voiceManager:
helloVoice: null
java.lang.NullPointerException
at test.VoiceGen.textToVoice(VoiceGen.java:31)
at test.MainClass.main(MainClass.java:9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
The code is as follows:
import java.io.File;
import javax.sound.sampled.AudioFileFormat.Type;
import com.sun.speech.freetts.Voice;
import com.sun.speech.freetts.VoiceManager;
import com.sun.speech.freetts.audio.AudioPlayer;
import com.sun.speech.freetts.audio.SingleFileAudioPlayer;
public class VoiceGen {
}
Any ideas on what could be the issue and how to resolve it?
Last edit: Devashi Tandon 2013-11-20
Found out the issue. Basically cmu_us_kal.jar contains the voices which was not included in my libraries on the linux boxes. After adding this file and all the others in the lib directory of freetts, the code works as expected. When including the libraries don't just include the freetts.jar but all the others as well.
Great, that it is working.
Dirk