This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java in General and the fly likes Java Speech API NullPointers problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Speech API NullPointers problem" Watch "Java Speech API NullPointers problem" New topic

Java Speech API NullPointers problem

E MacAoidh

Joined: Feb 11, 2005
Posts: 3
Hi, Im trying to get a sample piece of code up and running using the Java Speech API, I have tried many different tutorials, all are the same basic contents... in the Main method, a synthesizer is created and allocated...
Synthesizer synth = Central.createSynthesizer(
new SynthesizerModeDesc(Locale.ENGLISH));

Than when the speech is done, it is deallocated()

My code compiles fine, but when I try to run it, it has problems with the allocation and deallocation, it gives me a NullPointerException.

I have looked at many different tutorials, they all compile fine, and then when I run them I get the same error.
How can I make it work?!!
Any thoughts?
Im really stuck on this.....

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

Well, show us a stack trace. Tell us about your platform (Java version, OS, etc.)

[Jess in Action][AskingGoodQuestions]
E MacAoidh

Joined: Feb 11, 2005
Posts: 3
Hi Ernest,
Im using Jdeveloper, with Java 1.4 on Windows XP. Stack Trace having run the program is as follows:


at synth.Test.main(

Exception in MAIN method : java.lang.NullPointerException

I have been asking a number of colleagues about this problem, most seem to think its some problem with the classpath configuration and access to runtime libraries is setup. Im currently trying a few different things to that end. Do you think it could be anything else or would you have any better suggestions?
Thanks for your help,

I agree. Here's the link:
subject: Java Speech API NullPointers problem
It's not a secret anymore!