简体   繁体   English

FreeTTS挂在ColdFusion 8 / Java中

[英]FreeTTS hanging in ColdFusion 8 / Java

I'm looking into setting up a text-to-speech interpreter to make our CAPTCHA challenges ADA compliant. 我正在考虑设置文字转语音解释器,以使我们的CAPTCHA挑战兼容ADA。 We're a ColdFusion shop, and Ray Camden's already done the proof of concept for this last year. 我们是ColdFusion商店,而Ray Camden已经在去年完成了概念验证。 I've been using his blog post here - http://www.coldfusionjedi.com/index.cfm/2009/5/29/Generating-Speech-with-ColdFusion-and-Java - as a resource. 我一直在这里使用他的博客文章-http: //www.coldfusionjedi.com/index.cfm/2009/5/29/Generating-Speech-with-ColdFusion-and-Java作为资源。

Everything there works great... except for the part where FreeTTS is supposed to work. 那里的一切工作都很好……除了应该使用FreeTTS的部分。 I've got the following code: 我有以下代码:

<cfset jardir = expandPath("freetts-1.2.2-bin/freetts-1.2/lib") />
<cfset jars = [] />
<cfdirectory name="jarList" directory="#jardir#" />
<cfloop query="jarList">
    <cfset ArrayAppend(jars, jardir & "/" & name) />
</cfloop>

<cfset loader = createObject("component", "javaloader.JavaLoader").init(jars) />

<cfset voiceManager = loader.create("com.sun.speech.freetts.VoiceManager") />
<cfset vm = voiceManager.getInstance() />
<cfset voice = vm.getVoice("kevin16") />

<cfset voice.allocate() />
<!--- <cfset voice.speak("Hi.") /> --->
<cfset voice.deallocate() />

As this is, it runs fine and I can cfdump the voice object after the deallocate (or even after the allocate). 这样,它运行良好,我可以在取消分配之后(甚至在分配之后)cfdump语音对象。 So, from that you know the dependencies are in the right place and ColdFusion is instantiating everything correctly. 因此,您知道依赖项在正确的位置,并且ColdFusion正确地实例化了所有内容。 But as soon as I uncomment the call to speak(), the test script will hang on that method. 但是,一旦我取消对语音()的调用的注释,测试脚本就会挂在该方法上。

Signs point to some server configuration issue being the culprit here, but for the life of me I can't think of what it would be. 迹象表明某些服务器配置问题是这里的罪魁祸首,但是对于我一生来说,我无法想象会是什么。 (We're using ColdFusion 8.01, by the by.) If anyone could provide some additional insight into why FreeTTS would be misbehaving like this, I'd be much appreciative. (我们正在使用byFoldFusion 8.01。)如果有人可以提供一些其他的见解,以了解FreeTTS为什么会出现这种错误,我将不胜感激。

Update: This appears to be a more general Java issue. 更新:这似乎是一个更一般的Java问题。 ColdFusion's JRUN log is showing the following error being thrown as the server starts to hang: ColdFusion的JRUN日志显示服务器开始挂起时引发以下错误:

Exception in thread "Thread-667" java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, big-endian is supported.

Further, if I try to run FreeTTSHelloWorld.jar out of the box from the command line ( java -jar bin/FreeTTSHelloWorld.jar ), Java will hang and we'll have to force-quit with ^C. 此外,如果我尝试从命令行( java -jar bin/FreeTTSHelloWorld.jar )开箱即用地运行FreeTTSHelloWorld.jar,Java将挂起,并且我们必须使用^ C强制退出。

Do you have a sound card? 你有声卡吗? Try ( from the same post from ray ) writing the file to disk. 尝试(来自ray的同一帖子)将文件写入磁盘。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM