This discussion is archived
1 Reply Latest reply: Jul 31, 2011 5:22 AM by DarrylBurke RSS

NullPointException Error in Java Speech Synthesis Programming

879232 Newbie
Currently Being Moderated
I am new to the Java Speech synthesis programming . And this is my first Speech Synthesis Application .The following code shows a simple use of speech synthesis to speak the string "Hello World".

package helloworld;

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(
                    new SynthesizerModeDesc(Locale.ENGLISH));

               // Get it ready to speak

               // Speak the "Hello world" string
               synth.speakPlainText("Hello, world!", null);

               // Wait till speaking is done

               // Clean up
          } catch (Exception e) {

But if i run in Netbean7.0 than following error is found .....
at helloworld.HelloWorld.main(
BUILD SUCCESSFUL (total time: 1 second)

How i can solve this problem ?
Please tall me step by step way to solve this error .


  • Correct Answers - 10 points
  • Helpful Answers - 5 points