本文整理汇总了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);
}
}
}
示例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();
}
示例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();
}
示例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();
}