Package javax.speech.synthesis

Examples of javax.speech.synthesis.Synthesizer.deallocate()


      synthesizer.speakPlainText("Hello world!", null);
      synthesizer.waitEngineState(Synthesizer.QUEUE_EMPTY);
     
      /* Clean up and leave.
             */
      synthesizer.deallocate();
            System.exit(0);
           
  } catch (Exception e) {
      e.printStackTrace();
  }
View Full Code Here


      synthesizer1.speakPlainText("Goodbye everyone.", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);
     
      // clean up
      synthesizer1.deallocate();
      synthesizer2.deallocate();
  }
  catch (Exception e) {
      e.printStackTrace();
  }
View Full Code Here

     */
    public void close() {
  for (Iterator i = loadedSynthesizers.iterator(); i.hasNext();) {
      Synthesizer synth = (Synthesizer) i.next();
      try {
    synth.deallocate();
      } catch (EngineException ee) {
    System.out.println("Trouble closing the synthesizer: " + ee);
      }
  }
    }
View Full Code Here

                    Central.createSynthesizer(new SynthesizerModeDesc(Locale.US));
            synthesizer.allocate();
            synthesizer.resume();
            synthesizer.speakPlainText("Can you hear me now?", null);
            synthesizer.waitEngineState(Synthesizer.QUEUE_EMPTY);
            synthesizer.deallocate();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
View Full Code Here

          }
          synth.getSynthesizerProperties().setVoice(voice);
          synth.resume();
          synth.speakPlainText(text, null);
          synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
          synth.deallocate();
 
      } catch(Exception ex) {
          String message = " missing speech.properties in " + System.getProperty("user.home") + "\n";
          System.out.println("" + ex);
          System.out.println(message);
View Full Code Here

            for (Voice v : voices) {
                synthesizer.getSynthesizerProperties().setVoice(v);
                synthesizer.speakPlainText("good job", null);
                synthesizer.waitEngineState(0x10000L);
            }
            synthesizer.deallocate();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
View Full Code Here

    public void close() {
  //deallocate all synthesizer
        for (Iterator i = loadedSynthesizers.iterator(); i.hasNext();) {
      Synthesizer synth = (Synthesizer) i.next();
      try {
    synth.deallocate();
      } catch (EngineException ee) {
    System.out.println("Trouble closing the synthesizer: " + ee);
      }
  }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.