Package javax.speech.synthesis

Examples of javax.speech.synthesis.SynthesizerModeDesc


            System.setProperty("freetts.voices",
                    "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");

            Central.registerEngineCentral("com.sun.speech.freetts.jsapi.FreeTTSEngineCentral");
            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();
View Full Code Here


      try {
          System.setProperty("FreeTTSSynthEngineCentral", "com.sun.speech.freetts.jsapi.FreeTTSEngineCentral");
          System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
          Central.registerEngineCentral("com.sun.speech.freetts.jsapi.FreeTTSEngineCentral");
 
          SynthesizerModeDesc desc = new SynthesizerModeDesc(null, "general", Locale.US, null, null);
 
          Synthesizer synth = Central.createSynthesizer(desc);
          synth.allocate();
          desc = (SynthesizerModeDesc) synth.getEngineModeDesc();
          Voice[] voices = desc.getVoices();
          Voice voice = null;
          for (Voice entry : voices) {
              if(entry.getName().equals(voiceName)) {
                  voice = entry;
                  break;
View Full Code Here

  public HelloWorld() {
    }

    public static void listAllVoices(String modeName) {
        System.out.println("All " + modeName + " Mode JSAPI Synthesizers and Voices:");
        SynthesizerModeDesc required = new SynthesizerModeDesc(null, modeName, Locale.US, null, null);
        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

    }

    public static void main(String args[]) {
        // 利用 FreeTTS 读出Good job
        try {
            SynthesizerModeDesc desc = new SynthesizerModeDesc("FreeTTS en_US general synthesizer", "general",
                    Locale.US, null, null);
            Synthesizer synthesizer = Central.createSynthesizer(desc);
            if (synthesizer == null) {
                System.exit(1);
            }
            synthesizer.allocate();
            synthesizer.resume();
            desc = (SynthesizerModeDesc) synthesizer.getEngineModeDesc();
            Voice voices[] = desc.getVoices();
            for (Voice v : voices) {
                synthesizer.getSynthesizerProperties().setVoice(v);
                synthesizer.speakPlainText("good job", null);
                synthesizer.waitEngineState(0x10000L);
            }
View Full Code Here

        String audioFile = OpenFileToSave();
       
        if(audioFile == null)
            return;
       
        SynthesizerModeDesc desc = (SynthesizerModeDesc) PlayerModel.getSynthesizer().getEngineModeDesc();
        javax.speech.synthesis.Voice[] jsapiVoices = desc.getVoices();
        javax.speech.synthesis.Voice jsapiVoice = null;

        for(int i=0; i<jsapiVoices.length; i++)
        {
           if(jsapiVoices[i].getName().equals(PlayerModel.getVoice().getName()))
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

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.