Package marytts.modules.synthesis

Examples of marytts.modules.synthesis.Voice


      return;
    }
    if(text==null) {
      return;
    }
    Voice voice=null;
    if (StringUtils.isBlank(voiceName)) {
            logger.debug("Mary TTS: {} (Voice not set. Using default voice {}).", new String[] { text, defaultVoice.toString() });
            voice = defaultVoice;
    } else {
            voice = Voice.getVoice(voiceName);
            logger.debug("Mary TTS: {} (Voice: {})", new String[] { text, voiceName });
    }
   
    if (voice != null) {
      // Workaround: we have to set the Locale first, because only in the LocalMaryInterface.setLocale() method the required private method
      // LocalMaryInterface.setAudioFileFormatForVoice() method is called. After that we can set the voice, otherwise an NPE occurs
      marytts.setLocale(voice.getLocale());
      marytts.setVoice(voice.getName());
      try {
        AudioInputStream audio = marytts.generateAudio(text);
        AudioPlayer player = new AudioPlayer(audio);
        player.start();
        player.join();
View Full Code Here

TOP

Related Classes of marytts.modules.synthesis.Voice

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.