的FreeTTS,Java和Linux的:解决方法为" LINE不可用:格式为..." [英] FreeTTS, Java, Linux: Workaround for "LINE UNAVAILABLE: Format is ..."

查看:411
本文介绍了的FreeTTS,Java和Linux的:解决方法为" LINE不可用:格式为..."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行实例的FreeTTS,我得到这个错误:

When I run FreeTTS examples, I get this error:

LINE UNAVAILABLE: Format is pcm_signed 16000.0 Hz 16 bits 1 channel big endian

在这篇文章中,在Java中结果问题的FreeTTS
有人声称这是一个已知的Linux / Java的声音的bug,并具有一种变通方法,
链接到 http://forums.sun.com/thread.jspa?threadID=5189363

In this post, Freetts problem in Java
someone claims it's a known Linux/Java sound bug and has a workaround, linking to http://forums.sun.com/thread.jspa?threadID=5189363 .

但这个链接已经不因为甲骨文搞砸工作。
Archive.org似乎没有这个网页存档。

But this link does not work anymore since Oracle screwed it. Archive.org seems not to have this page archived.

有没有人有解决方法/补丁的FreeTTS?

Does anyone have the workaround / patch for FreeTTS?

谢谢,
Ondra

Thanks, Ondra

推荐答案

嗯,我有更好的运气问这个问题后,谷歌搜索,所以...:
http://workorhobby.blogspot.com/2011/02 /java-audio-freetts-line-unavailable.html
非常感谢作者。

Hmm, I had better luck googling after asking the question, so...: http://workorhobby.blogspot.com/2011/02/java-audio-freetts-line-unavailable.html A big thanks to the author.

更新:其实,这并不是一个很好的解决方法,因为它会继续上的FreeTTS搁置,直到线路空闲

Update: Actually, this is not a nice workaround since it will keep FreeTTS on hold until the line is free.

FWIU,所提到的贴片具有更好的解决方案 - 不苛求独占访问或如

FWIU, the mentioned patch had better solution - not demanding exclusive access or such.

更新:我编一个<一个href=\"http://ondra.zizka.cz/stranky/programovani/java/misc/freetts-line-unavailable-classcastexception-kevinvoicedirectory-error-opening-zipfile.texy\"相对=nofollow>故障排除的FreeTTS 页。

根据的FreeTTS程序,自由文本到语音引擎的Java,渐渐偶然的错误

A program based on FreeTTS, the free text-to-speech engine for Java, was getting occasional errors

"LINE UNAVAILABLE: Format is ..."

原来没有Java异常或其他机制来检测这种错误,该库的FreeTTS内发生。你得到的是System.out的消息,所以以编程方式做出反应的好方法。

Turns out there is no Java Exception or other mechanism to detect this error that occurs inside the FreeTTS library. All you get is the message on System.out, so there is no good way to react programatically.

解决方法:配置的FreeTTS音频播放器试图访问音频设备超过一次,直到成功为止。在这个例子中,0.1秒的短时间延迟是用来不会错过的机会抢音频设备;我们一直在努力,持续30秒:

Workaround: Configure the FreeTTS audio player to attempt accessing the audio device more than once until it succeeds. In this example, a short delay of 0.1 seconds is used to not miss an opportunity to grab the audio device; we keep trying for 30 seconds:

System.setProperty("com.sun.speech.freetts.audio.AudioPlayer.openFailDelayMs", "100");
System.setProperty("com.sun.speech.freetts.audio.AudioPlayer.totalOpenFailDelayMs", "30000");

如果音频设备永久其他程序使用,则当然没有办法得到访问。在Linux下,该命令将显示当前持有音频设备的进程的ID,所以那么你可以尝试摆脱违规项目:

If the audio device is permanently used by another program, there is of course no way to get access. Under Linux, this command will display the ID of the process that is currently holding the audio device, so you can then try to get rid of the offending program:

/sbin/fuser /dev/dsp

这篇关于的FreeTTS,Java和Linux的:解决方法为&QUOT; LINE不可用:格式为...&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆