Package javax.speech.synthesis

Examples of javax.speech.synthesis.SynthesizerModeDesc


    Voice kevinHQ = new Voice("kevin16",Voice.GENDER_DONT_CARE, Voice.AGE_DONT_CARE, null);
     
    // Create a new SynthesizerModeDesc that will match the
    // Unlimited domain FreeTTS Synthesizer.
   
    SynthesizerModeDesc unlimitedDesc =
    new SynthesizerModeDesc(
        "Unlimited domain FreeTTS Speech Synthesizer from Sun Labs",
        null,
        Locale.US,
        Boolean.FALSE,         // running?
        null);                 // voice
View Full Code Here


             * speech.properties file, you can circumvent the Central
             * class and do a very non-JSAPI thing by talking to
             * FreeTTSEngineCentral directly.  See the WebStartClock
             * demo for an example of how to do this.
             */
      SynthesizerModeDesc desc = new SynthesizerModeDesc(
                null,          // engine name
                "general",     // mode name
                Locale.US,     // locale
                null,          // running
                null);         // voice
      Synthesizer synthesizer = Central.createSynthesizer(desc);

            /* Just an informational message to guide users that didn't
             * set up their speech.properties file.
             */
      if (synthesizer == null) {
    System.err.println(noSynthesizerMessage());
    System.exit(1);
      }

      /* Get the synthesizer ready to speak
             */
      synthesizer.allocate();
      synthesizer.resume();

            /* Choose the voice.
             */
            desc = (SynthesizerModeDesc) synthesizer.getEngineModeDesc();
            Voice[] voices = desc.getVoices();
            Voice voice = null;
            for (int i = 0; i < voices.length; i++) {
                if (voices[i].getName().equals(voiceName)) {
                    voice = voices[i];
                    break;
View Full Code Here

        voice = new Voice(voiceName,
        Voice.GENDER_DONT_CARE,
        Voice.AGE_DONT_CARE,
        null);

  SynthesizerModeDesc modeDesc = new SynthesizerModeDesc(
      null, "general", Locale.US, null, null);

  try {
      synthesizer = Central.createSynthesizer(modeDesc);
View Full Code Here

             * speech.properties file, you can circumvent the Central
             * class and do a very non-JSAPI thing by talking to
             * FreeTTSEngineCentral directly.  See the WebStartClock
             * demo for an example of how to do this.
             */
      SynthesizerModeDesc generalDesc = new SynthesizerModeDesc(
    null,          // engine name
                "general",     // mode name
                Locale.US,     // locale
                null,          // running
                null);         // voice
           
      final Synthesizer synthesizer1 =
                Central.createSynthesizer(generalDesc);

      if (synthesizer1 == null) {
    System.err.println(
                    noSynthesizerMessage("general domain synthesizer"));
    System.exit(1);
      }

      /* Find a synthesizer that has the time domain voice.
             */
      SynthesizerModeDesc limitedDesc = new SynthesizerModeDesc(
                null,          // engine name
                "time",        // mode name
                Locale.US,     // locale
                null,          // running
                null);         // voice
View Full Code Here

     */
    public void setVoice(String voiceName) {
        PlayerModel model = getModel();
        ListModel descList = model.getSynthesizerList();
        for (int i = 0; i < descList.getSize(); i++) {
            SynthesizerModeDesc desc = (SynthesizerModeDesc)
                descList.getElementAt(i);
            Voice[] voices = desc.getVoices();
            for (int j = 0; j < voices.length; j++) {
                if (voices[j].getName().equals(voiceName)) {
                    model.setSynthesizer(i);
                    model.setVoice(j);
                    break;
View Full Code Here

     * Creates the synthesizer, called by the constructor.
     */
    public void createSynthesizer() {

        try {
            SynthesizerModeDesc desc =
                new SynthesizerModeDesc(null,
                                        "time",
                                        Locale.US,
                                        Boolean.FALSE,
                                        null);

View Full Code Here

     * Takes the default prosody values (pitch, range, volume, rate)
     * from the default voice.
     * Override to set engine-specific defaults.
     */
    protected BaseEngineProperties createEngineProperties() {
        SynthesizerModeDesc desc = (SynthesizerModeDesc)engineModeDesc;
        FreeTTSVoice defaultVoice = (FreeTTSVoice)(desc.getVoices()[0]);
        return new FreeTTSSynthesizerProperties(defaultVoice,
       defaultVoice.getPitch(),
       defaultVoice.getPitchRange(),
       defaultVoice.getSpeakingRate(),
       defaultVoice.getVolume());
View Full Code Here

        /* Create a template that tells JSAPI what kind of speech
         * synthesizer we are interested in.  In this case, we're
         * just looking for a general domain synthesizer for US
         * English.
         */
        SynthesizerModeDesc required = new SynthesizerModeDesc(
            null,      // engine name
            modeName,  // mode name
            Locale.US, // locale
            null,      // running
            null);     // voices

        /* Contact the primary entry point for JSAPI, which is
         * the Central class, to discover what synthesizers are
         * available that match the template we defined above.
         */
        EngineList engineList = Central.availableSynthesizers(required);
        for (int i = 0; i < engineList.size(); i++) {
           
            SynthesizerModeDesc desc = (SynthesizerModeDesc) engineList.get(i);
            System.out.println("    " + desc.getEngineName()
                               + " (mode=" + desc.getModeName()
                               + ", locale=" + desc.getLocale() + "):");
            Voice[] voices = desc.getVoices();
            for (int j = 0; j < voices.length; j++) {
                System.out.println("        " + voices[j].getName());
            }
        }
    }
View Full Code Here

             * speech.properties file, you can circumvent the Central
             * class and do a very non-JSAPI thing by talking to
             * FreeTTSEngineCentral directly.  See the WebStartClock
             * demo for an example of how to do this.
             */
      SynthesizerModeDesc desc = new SynthesizerModeDesc(
                null,          // engine name
                "time",        // mode name
                Locale.US,     // locale
                null,          // running
                null);         // voice

      synthesizer = Central.createSynthesizer(desc);

            /* Just an informational message to guide users that didn't
             * set up their speech.properties file.
             */
      if (synthesizer == null) {
    System.err.println(noSynthesizerMessage());
    System.exit(1);
      }

      /* Get the synthesizer ready to speak
             */
      synthesizer.allocate();
      synthesizer.resume();

            /* Choose the voice.
             */
            desc = (SynthesizerModeDesc) synthesizer.getEngineModeDesc();
            Voice[] voices = desc.getVoices();
            Voice voice = null;
            for (int i = 0; i < voices.length; i++) {
                if (voices[i].getName().equals(voiceName)) {
                    voice = voices[i];
                    break;
View Full Code Here

     *
     * @return a <code>BaseEngineProperties</code> object specific to
     *   a subclass.
     */
    protected BaseEngineProperties createEngineProperties() {
        SynthesizerModeDesc desc = (SynthesizerModeDesc)engineModeDesc;
        BaseVoice defaultVoice = (BaseVoice)(desc.getVoices()[0]);
       
        float defaultPitch = defaultVoice.defaultPitch;
        float defaultPitchRange = defaultVoice.defaultPitchRange;
        float defaultSpeakingRate = defaultVoice.defaultSpeakingRate;
        float defaultVolume = defaultVoice.defaultVolume;
View Full Code Here

TOP

Related Classes of javax.speech.synthesis.SynthesizerModeDesc

Copyright © 2018 www.massapicom. 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.