当前位置: 首页>>代码示例>>Java>>正文


Java MaryConfigurationException类代码示例

本文整理汇总了Java中marytts.exceptions.MaryConfigurationException的典型用法代码示例。如果您正苦于以下问题:Java MaryConfigurationException类的具体用法?Java MaryConfigurationException怎么用?Java MaryConfigurationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MaryConfigurationException类属于marytts.exceptions包,在下文中一共展示了MaryConfigurationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: say

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public static void say(String comment) {
	if (isSilenced) {
		System.out.println(comment);
		return;
	}

	try {
		if (!inited) {
			init();
		}

		if (comment.isEmpty()) return;

		final AudioInputStream audio = marytts.generateAudio(comment);
		final AudioPlayer player = new AudioPlayer(audio);
		player.start();
	} catch (MaryConfigurationException | SynthesisException e) {
		logger.error("Error sythesizing text to voice", e);
	}
}
 
开发者ID:phrack,项目名称:ShootOFF,代码行数:21,代码来源:TextToSpeech.java

示例2: openMaryTTS

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
/**
 * Creates the connection to a Mary-TTS server or starts a local instantiation
 * if no host is set
 */
void openMaryTTS() 
{
	if (serverHost.length()>0) // use a server or instantiate a local interface
	{
		try    // server
		{ 
			marytts= new RemoteMaryInterface(serverHost, serverPort);
		}
		catch(IOException ioe) { Log.print(Log.ERROR, ioe.getMessage()); }
	}else{
		try    // local
		{
			marytts = new LocalMaryInterface();
		}
		catch(MaryConfigurationException mce) { Log.print(mce); }
	}
}
 
开发者ID:scbickle,项目名称:maryspeak,代码行数:22,代码来源:Process.java

示例3: init

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void init() {
	for (Logger l : Collections.<Logger> list(LogManager.getCurrentLoggers())) {
		l.setLevel(Level.OFF);
	}
	
	LogManager.getRootLogger().setLevel(Level.OFF);
	
	try {
		marytts = new LocalMaryInterface();
	} catch (MaryConfigurationException e) {
		e.printStackTrace();
	}
	
	Set<String> voices = marytts.getAvailableVoices();
	System.out.println(voices);
	marytts.setVoice(voice);
}
 
开发者ID:Dakror,项目名称:WebcamParser,代码行数:19,代码来源:Reader.java

示例4: TextToSpeech

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
/**
 * Constructor
 */
public TextToSpeech() {
	try {
		marytts = new LocalMaryInterface();
		
	} catch (MaryConfigurationException ex) {
		Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex);
	}
}
 
开发者ID:goxr3plus,项目名称:Java-Google-Speech-Recognizer,代码行数:12,代码来源:TextToSpeech.java

示例5: initMaryTTS

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public void initMaryTTS() throws MaryConfigurationException {
   log.debug("Initialiazing MaryTTS");
   marytts = new LocalMaryInterface();

   String voice = PROPERTIES.getVoice();
   log.debug("Setting voice to: " + voice);
   marytts.setVoice(voice);

   String effects = SoundEffect.toMaryTTSString();
   log.debug("Setting effects to: " + effects);
   marytts.setAudioEffects(effects);
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:13,代码来源:Speeker.java

示例6: initSpeeker

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
private void initSpeeker() {
   try {
      speeker = new Speeker();
   } catch (MaryConfigurationException e) {
      log.error("Unable to start configure popular phrases dialog", e);
      JOptionPane.showMessageDialog(PopularPhrasesConfigDialog.this, MESSAGES.get("init_marytts_error"),
            MESSAGES.get("error"), JOptionPane.ERROR_MESSAGE);
   }
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:10,代码来源:PopularPhrasesConfigDialog.java

示例7: initMaryTts

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
private void initMaryTts() {
   try {
      marytts = new LocalMaryInterface();
   } catch (MaryConfigurationException e) {
      JOptionPane.showMessageDialog(VoiceConfigurationDialog.this, MESSAGES.get("init_marytts_error"),
            MESSAGES.get("error"), JOptionPane.ERROR_MESSAGE);
      log.error("Unable to start marytts", e);
   }
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:10,代码来源:VoiceConfigurationDialog.java

示例8: ApplicationWindow

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public ApplicationWindow(Speeker speeker) throws MaryConfigurationException {
   super(MESSAGES.get("client_window_title"));
   this.speeker = speeker;
   speeker.addEndOfSpeechListener(this);
   speeker.addSpeechListener(this);
   setDefaultCloseOperation(EXIT_ON_CLOSE);
   if (PROPERTIES.isNativeHookEnabled()) {
      initNativeHook();
   }
   initGui();
   addWindowListener(new WindowOpenedListener());
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:13,代码来源:ApplicationWindow.java

示例9: initMaryTTS

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public void initMaryTTS() throws MaryConfigurationException {
   log.debug("Initialiazing MaryTTS");
   marytts = new LocalMaryInterface();

   String voice = Voice.getSelectedVoice().getName();
   log.debug("Setting voice to: " + voice);
   marytts.setVoice(voice);

   String effects = SoundEffect.toMaryTTSString();
   log.debug("Setting effects to: " + effects);
   marytts.setAudioEffects(effects);
}
 
开发者ID:raginggoblin,项目名称:speechless,代码行数:13,代码来源:Speeker.java

示例10: main

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public static void main(String[] args) {
   loadLaf(args);
   setLocale();

   SplashScreen splashScreen = new SplashScreen();
   ScreenPositioner.centerOnScreen(splashScreen);
   splashScreen.setVisible(PROPERTIES.isSplashScreenEnabled());

   try {
      Speeker speeker = new Speeker();
      Runtime.getRuntime().addShutdownHook(new ShutdownHook(speeker));
      ClientWindow clientWindow = new ClientWindow(speeker);
      splashScreen.setVisible(false);
      splashScreen.dispose();
      if (PROPERTIES.isWelcomeScreenEnabled()) {
         WelcomeScreen welcomeScreen = new WelcomeScreen();
         ScreenPositioner.centerOnScreen(welcomeScreen);
         welcomeScreen.setVisible(true);
      }
      clientWindow.setVisible(true);
      if (PROPERTIES.isStartMinimized()) {
         clientWindow.setExtendedState(Frame.ICONIFIED);
      }
   } catch (MaryConfigurationException e) {
      log.error("Unable to start Speeker", e);
      splashScreen.setMessage(MESSAGES.get("initialization_error"));
      try {
         Thread.sleep(5000);
      } catch (InterruptedException e1) {
         log.error(e.getMessage(), e);
      }
      System.exit(0);
   }
}
 
开发者ID:raginggoblin,项目名称:speechless,代码行数:35,代码来源:Application.java

示例11: ClientWindow

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public ClientWindow(Speeker speeker) throws MaryConfigurationException {
   super(MESSAGES.get("client_window_title"));
   this.speeker = speeker;
   speeker.addEndOfSpeechListener(this);
   initGui();
   if (PROPERTIES.isNativeHookEnabled()) {
      initNativeHook();
   }
   setDefaultCloseOperation(EXIT_ON_CLOSE);
}
 
开发者ID:raginggoblin,项目名称:speechless,代码行数:11,代码来源:ClientWindow.java

示例12: MaryTTS

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public MaryTTS(String voiceName)
{
	try
	{
		System.setProperty("log4j.logger.marytts", "OFF"); //default is INFO, to log/server.log
		System.setProperty("de.phonemiser.logunknown", "false");
		maryTTS = new LocalMaryInterface();
		maryTTS.setVoice(voiceName);
	}
	catch (MaryConfigurationException mce)
	{
		logger.log(Level.SEVERE, "Can't initialize LocalMaryInterface", mce);
	}
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:15,代码来源:MaryTTS.java

示例13: activate

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public void activate() {
	try {
		marytts = new LocalMaryInterface();
		Locale systemLocale = Locale.getDefault();
		if (marytts.getAvailableLocales().contains(systemLocale)) {
			defaultVoice = Voice.getDefaultVoice(systemLocale);
		}
		if (defaultVoice==null) {
			// Fallback
			defaultVoice = Voice.getVoice(marytts.getAvailableVoices().iterator().next());
		}
	} catch (MaryConfigurationException e) {
		logger.error("Error connecting to Mary TTS: " + e.getLocalizedMessage(), e);
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:16,代码来源:TTSServiceMaryTTS.java

示例14: getMaryInterface

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
/**
 * Create the MaryInterface
 *
 * @return The MaryInterface
 */
private static final MaryInterface getMaryInterface() {
    MaryInterface maryInterface = null;
    try {
        maryInterface = new LocalMaryInterface();
    } catch (MaryConfigurationException e) {
        throw new RuntimeException("Error creating MaryInterface", e);
    }
    return maryInterface;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:15,代码来源:MaryTTSService.java

示例15: activate

import marytts.exceptions.MaryConfigurationException; //导入依赖的package包/类
public void activate() {
    try {
        marytts = new LocalMaryInterface();
        Locale systemLocale = Locale.getDefault();
        if (marytts.getAvailableLocales().contains(systemLocale)) {
            defaultVoice = Voice.getDefaultVoice(systemLocale);
        }
        if (defaultVoice == null) {
            // Fallback
            defaultVoice = Voice.getVoice(marytts.getAvailableVoices().iterator().next());
        }
    } catch (MaryConfigurationException e) {
        logger.error("Error connecting to Mary TTS: " + e.getLocalizedMessage(), e);
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:16,代码来源:TTSServiceMaryTTS.java


注:本文中的marytts.exceptions.MaryConfigurationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。