Package javax.speech.synthesis

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


      /* The the synthesizer to speak and wait for it to
             * complete.
             */
      synthesizer.speakPlainText("Hello world!", null);
      synthesizer.waitEngineState(Synthesizer.QUEUE_EMPTY);
     
      /* Clean up and leave.
             */
      synthesizer.deallocate();
            System.exit(0);
View Full Code Here


      synthesizer1.speakPlainText("I am a die phone synthesizer", null);
      synthesizer1.speakPlainText("I have a friend named Alan.", null);
      synthesizer1.speakPlainText("Listen to him count!", null);

      // get synth2 ready to speak
      synthesizer2.waitEngineState(Synthesizer.ALLOCATED);
      synthesizer2.resume();

      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);
      synthesizer2.speakPlainText("1 2 3 4 5 6 7 8 9 ten", null);
View Full Code Here

      synthesizer2.resume();

      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);
      synthesizer2.speakPlainText("1 2 3 4 5 6 7 8 9 ten", null);

      synthesizer2.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer1.speakPlainText("Now listen to me count!", null);
      synthesizer1.speakPlainText("1 2 3 4 5 6 7 8 9 10.", null);

      synthesizer1.speakPlainText(
View Full Code Here

    "Hey Alan, what time is it where you are right now?", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer2.speakPlainText(
        "the time is now twenty past six.", null);
      synthesizer2.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer1.speakPlainText("Is that the exact time?", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer2.speakPlainText("Almost", null);
View Full Code Here

      synthesizer1.speakPlainText("Is that the exact time?", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer2.speakPlainText("Almost", null);
      synthesizer2.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer1.speakPlainText(
    "Is it twenty past six In the morning or the evening?", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);
View Full Code Here

      synthesizer1.speakPlainText(
    "Is it twenty past six In the morning or the evening?", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer2.speakPlainText("in the morning.", null);
      synthesizer2.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer1.speakPlainText(
        "Alan and I can talk at the same time", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);
View Full Code Here

      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer1.speakPlainText("1 2 3 4 5 6 7 8 9 11 12", null);
      synthesizer2.speakPlainText("1 2 3 4 5 6 7 8 9", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);
      synthesizer2.waitEngineState(Synthesizer.QUEUE_EMPTY);

      synthesizer1.speakPlainText( "That is a bit confusing.", null);
      synthesizer1.speakPlainText( "Well, thanks. This was fun.", null);
      synthesizer1.speakPlainText("Goodbye everyone.", null);
      synthesizer1.waitEngineState(Synthesizer.QUEUE_EMPTY);
View Full Code Here

            Synthesizer synthesizer =
                    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);
View Full Code Here

            desc = (SynthesizerModeDesc) synthesizer.getEngineModeDesc();
            Voice voices[] = desc.getVoices();
            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

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.