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


Java AudioPlayer.join方法代码示例

本文整理汇总了Java中marytts.util.data.audio.AudioPlayer.join方法的典型用法代码示例。如果您正苦于以下问题:Java AudioPlayer.join方法的具体用法?Java AudioPlayer.join怎么用?Java AudioPlayer.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在marytts.util.data.audio.AudioPlayer的用法示例。


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

示例1: speakBlocking

import marytts.util.data.audio.AudioPlayer; //导入方法依赖的package包/类
public synchronized void speakBlocking(String text) //synchronized so that together with the call to join(), calls to this method will wait until previous calls are finished
{
	if (text != null && !text.isEmpty())
	{
		try
		{
			AudioPlayer ap = new AudioPlayer();
			ap.setAudio(maryTTS.generateAudio(text));
			ap.start();
			ap.join();
		}
		catch (SynthesisException se)
		{
			logger.log(Level.SEVERE, "MaryTTS failed to generate audio for text \"" + text + "\"", se);
		}
		catch (InterruptedException ie)
		{
			logger.log(Level.SEVERE, "MaryTTS AudioPlayer thread was interrupted.", ie);
		}
	}
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:22,代码来源:MaryTTS.java

示例2: executeSpeaking

import marytts.util.data.audio.AudioPlayer; //导入方法依赖的package包/类
private void executeSpeaking(String speech) throws SynthesisException, InterruptedException {
   AudioInputStream audio = marytts.generateAudio(speech.trim());
   currentlySpeeking = new AudioPlayer(audio);
   log.debug("Speeking: " + speech.trim());
   notifySpeechListeners(speech.trim());
   currentlySpeeking.start();
   currentlySpeeking.join();
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:9,代码来源:Speeker.java

示例3: executeSpeaking

import marytts.util.data.audio.AudioPlayer; //导入方法依赖的package包/类
private void executeSpeaking(String speech) throws SynthesisException, InterruptedException {
   AudioInputStream audio = marytts.generateAudio(speech);
   currentlySpeeking = new AudioPlayer(audio);
   log.debug("Speeking: " + speech);
   currentlySpeeking.start();
   currentlySpeeking.join();
}
 
开发者ID:raginggoblin,项目名称:speechless,代码行数:8,代码来源:Speeker.java

示例4: read

import marytts.util.data.audio.AudioPlayer; //导入方法依赖的package包/类
public static void read(String s) throws SynthesisException, InterruptedException {
	AudioInputStream audio = marytts.generateAudio(s.length() > 0 ? s : "Ich kann das leider nicht lesen.");
	
	player = new AudioPlayer(audio);
	player.start();
	player.join();
}
 
开发者ID:Dakror,项目名称:WebcamParser,代码行数:8,代码来源:Reader.java


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