Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

regardin JSAPI  RSS feed

 
krishna balaji
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[code]
public static void main (String [] args)
{
try
{

// Create a synthesizer for the default
// locale.

synth = Central.createSynthesizer(null);

// Allocate synthesizer resources.

synth.allocate ();//i m gettin null pointe error here y ?

// Place synthesizer in the RESUMED
// state so that it can produce speech
// as it receives text.

synth.resume ();
}
catch (Exception e)
{
System.out.println(e);
System.exit (0);
}

[code]

in the above peice of code i get null pinter error wen i try to allocate
whats the problem i also want to know how do i use Java Speech API to my own programs
 
Sanjeev Singh
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It has to do nothing with JSAPI. If you are getting NullPointerException means you are invoking a method on a reference which is refereing to null.Debug using some IDE and try to find out that reference.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!