Hello everyone,
I've just been trying to run the basic JSAPI 'Hello World' program.
It's taken me a while to figure out how to get it to work (and
to download everything) but now I have it to this point.
I have a few of the same errors that pop up.
Here is the code:
package helloworldsynthesis;
import javax.speech.*;
import javax.speech.synthesis.*;
import java.util.Locale;
public class Main {
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();
}
}
}
At lines: 14, 15, 18, 21 and 24 (WOW!) I have a java.lang.NullPointerException.
I would be very greatful for any help with this problem!
-WolfShield