2

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.

Eric Kolb
  • 996
  • 6
  • 9
  • 1
    http://www.google.com/recaptcha doesn't work for you? – Henry Jul 28 '10 at 19:20
  • Is FreeTTs throwing any error into cfserver.log (or wherever stdout is being logged on your installation)? – Edward M Smith Jul 28 '10 at 19:32
  • @Edward M Smith - Negative. None of the logs updated today hold any relevant feedback. – Eric Kolb Jul 28 '10 at 19:45
  • 1
    @Eric Kolb - Maybe enabling its logging will produce additional details? Assuming you are on a dev machine, try voice.setDetailedMetrics(true). By default the logs will probably end up in rumtime/bin. I do not know how large the log files get. So you may want to keep an eye on that. – Leigh Jul 29 '10 at 10:16
  • @Leigh I'll give that a shot. I may need to work with the folks downstairs to find where any output from that is being logged to. (I don't have unrestricted access to the server.) – Eric Kolb Jul 29 '10 at 15:06
  • @Eric Kolb - You can redirect the logs to a different location using a "FileHandler". The basics for configuration are here: http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html#2.2 – Leigh Jul 29 '10 at 16:05
  • I've found the log. Seems the destination server doesn't support the default source line: 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. I'm working from that lead. – Eric Kolb Jul 29 '10 at 17:05
  • I cannot say I have heard of that one. Any relation to this bug ? http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5068865 – Leigh Jul 30 '10 at 11:23
  • @Leigh - I don't think so. This is about to become a dead project; the company doesn't value it highly enough at this time for me to be investing this much time into it right now. – Eric Kolb Jul 30 '10 at 14:09
  • @Henry - I've checked that out just now as an alternative. It's a usability nightmare; since reCAPTCHA uses illegible/inaudible samples from sources Google is trying to digitize, the result is that the user is asked to transcribe portions of audio that software wasn't able to. A lot of the time, this results in audio samples that make people here in the office ask, "What the hell was that?" It's certainly nothing I'd recommend to the company to use. – Eric Kolb Jul 30 '10 at 14:12
  • @Eric Kolb - Understood. Sorry to hear that. – Leigh Jul 30 '10 at 14:28
  • @Eric, I guess it was done in that way to combat against voice recognition software... – Henry Jul 30 '10 at 18:08
  • Maybe try non-captcha based spam reduction? http://cfformprotect.riaforge.org/ – Henry Jul 30 '10 at 18:10

1 Answers1

0

Do you have a sound card? Try ( from the same post from ray ) writing the file to disk.