3 Replies Latest reply: Mar 23, 2009 4:44 AM by 843802 RSS

    javax.speech.Central.createSynthesizer returns null for default Loale

    843802
      Hi I'm trying to learn the JSAPI for a project and I have this problem with the HelloWorld program on Linux Ubuntu 8.04
      import javax.speech.synthesis.* ;
      import javax.speech.* ;
      
      public class HelloWorld {
           public static void main ( String [ ] args ) {
                try {
                     Synthesizer synth = Central
                               .createSynthesizer ( null ) ; // createSynthesizer returns null
                     if ( synth != null ) { 
                          synth.allocate () ;
                          synth.resume () ;
                          synth.speakPlainText ( "Hello, World", null ) ;
                          synth.waitEngineState ( Synthesizer.QUEUE_EMPTY ) ;
                     } else {
                          System.err.println ( "Error!\n" ) ; // So this is my output
                     }
                } catch ( Exception e ) {
                     e.printStackTrace () ;
                }
           }
      }
      now I went through the Doc and it said that createSynthesizer returns null if the Locale is not available. But I'm using the default locale, and it still returns null. :( any help?