• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

regardin JSAPI

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I am displeased. You are no longer allowed to read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic