views:

63

answers:

0

I'm looking into setting up a text-to-speech interpreter to make our CAPTCHA challenges ADA compliant. We're a ColdFusion shop, and Ray Camden's already done the proof of concept for this last year. 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.

Everything there works great... except for the part where FreeTTS is supposed to work. 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). So, from that you know the dependencies are in the right place and ColdFusion is instantiating everything correctly. 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.

Update: This appears to be a more general Java issue. ColdFusion's JRUN log is showing the following error being thrown as the server starts to hang:

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.