Hello friends
I am new to jsapi
When i am trying to run the hello world program as given below, it throws a null-pointer exception at the line containing synth.allocate();
import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;
public class HelloWorld {
public static void main(
String args[]) {
try {
// Create a synthesizer for English
Synthesizer synth = Central.createSynthesizer(null);
//new SynthesizerModeDesc(Locale.ENGLISH));
// Get it ready to speak
synth.allocate();
synth.resume();
// Speak the "Hello world" string
synth.speakPlainText("Hello, world!", null);
// Wait till speaking is done
synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
// Clean up
synth.deallocate();
} catch (Exception e) {
System.out.println("Exception occured :"+e+"\n");
e.printStackTrace();
}
}
}
I am not able to resolve it.
Please help me out.......
It seems that there is some problem with classpath but i am not able to correct it.
Please help.
Thanks in advance................