i use speech synthesis javax.speech.synthesis for the first time
my program is simple that's say string "hello world"
but that not work and give me that Exception:

java.lang.NullPointerException
at soundreal.HelloWorld.main(HelloWorld.java:20)

and i don't know what that mean help plz

package soundreal;

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
			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) {
			e.printStackTrace();
		}
	}
}

you're getting a nullpointerexception somewhere on line 20, but since there's no code on line 20...
I assume there's a problem in your use of the Synthesizer class, but since I've never seen it, don't know which one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.