Package com.sun.speech.freetts

Examples of com.sun.speech.freetts.VoiceManager


 
  public Voice getVoice() {
    System.setProperty("freetts.voices","com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
    if(this.voice == null) {
          VoiceManager voiceManager = VoiceManager.getInstance();
      Voice helloVoice = voiceManager.getVoice("kevin16");
      if (helloVoice == null) {
        System.err.println("Cannot find voices");
        for(Voice voice : voiceManager.getVoices()) {
          System.out.println("Voice: " + voice.getName());
        }
      }
      helloVoice.allocate();
      this.voice = helloVoice;
View Full Code Here


            } else {
                //use default basic voices
                System.setProperty("freetts.voices", "com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory");
                voice = VoiceManager.getInstance().getVoice(Utilities.getProperty("voice16kName", "kevin16"));
            }
            VoiceManager voiceManager = VoiceManager.getInstance();
            Voice[] voices = voiceManager.getVoices();
            if (voices.length <= 0) {
                Freedomotic.logger.severe("Cannot use text to speech, no voice found");
                setDescription("Cannot use text to speech, no voice found");
                stop();
            } else {
View Full Code Here

     * Example of how to list all the known voices.
     */
    public static void listAllVoices() {
        System.out.println();
        System.out.println("All voices available:");       
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice[] voices = voiceManager.getVoices();
        for (int i = 0; i < voices.length; i++) {
            System.out.println("    " + voices[i].getName()
                               + " (" + voices[i].getDomain() + " domain)");
        }
    }
View Full Code Here

        System.out.println();
        System.out.println("Using voice: " + voiceName);
       
        /* The VoiceManager manages all the voices for FreeTTS.
         */
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice helloVoice = voiceManager.getVoice(voiceName);

        if (helloVoice == null) {
            System.err.println(
                "Cannot find a voice named "
                + voiceName + ".  Please specify a different voice.");
View Full Code Here

    /**
     * Creates and loads the Voice.
     */
    private void createVoice(String voiceName) {
        VoiceManager voiceManager = VoiceManager.getInstance();
        emacsVoice = voiceManager.getVoice(voiceName);
        if (emacsVoice == null) {
            System.err.println("No such voice with the name: " + voiceName);
            System.exit(1);
        }
        emacsVoice.allocate();
View Full Code Here

     * by default.
     */
    public Server() {
  port = Utilities.getInteger("port", 5555).intValue();
  try {
            VoiceManager voiceManager = VoiceManager.getInstance();
      voice8k = voiceManager.getVoice(voice8kName);
      voice16k = voiceManager.getVoice(voice16kName);
            voice8k.allocate();
            voice16k.allocate();
  } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
View Full Code Here

    }

    public static void listAllVoices() {
        System.out.println();
        System.out.println("All voices available:");
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice voices[] = voiceManager.getVoices();
        for (int i = 0; i < voices.length; i++)
            System.out.println("    " + voices[i].getName() + " (" + voices[i].getDomain() + " domain)");

    }
View Full Code Here

    }

    public static void main(String args[]) {
        listAllVoices();
        System.out.println();
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice helloVoice = voiceManager.getVoice("kevin16");
        if (helloVoice == null) {
            System.exit(1);
        }
        helloVoice.allocate();
        helloVoice.speak("all over the world, you can see");
View Full Code Here

    System.out.println();
    System.out.println("使用声音: " + voiceName);

    /* The VoiceManager manages all the voices for FreeTTS.
     */
    VoiceManager voiceManager = VoiceManager.getInstance();
    Voice helloVoice = voiceManager.getVoice(voiceName);

    if (helloVoice == null) {
      System.err.println( "找不到你所指定的声音. "  + voiceName + "请选择另一种.");
      System.exit(1);
    }
View Full Code Here

     * Example of how to list all the known voices.
     */
    public static void listAllVoices() {
        System.out.println();
        System.out.println("All voices available:");
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice[] voices = voiceManager.getVoices();
        for (int i = 0; i < voices.length; i++) {
            System.out.println("    " + voices[i].getName()
                    + " (" + voices[i].getDomain() + " domain)");
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.speech.freetts.VoiceManager

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.