Next week I'm giving a Sphinx-4 talk and demo. The talk is ready, but I still need a good demo. Willie came up with an idea for a really cool demo, but it may not pan out, so I needed a backup demo, just in case. For a backup, I thought I would integrate our speech recognizer with a chess game. The idea is that you can control the chess game with command like "move the queen to A5" I figured there would be few open source all-Java chess demos out there and I'd be able to find one that I could integrate with our recognizer.

Indeed, I looked on SourceForge and FreshMeat and found a number of them. A couple of them wouldn't compile, a couple wouldn't run, one looked really nice, but was too hard to figure out how to integrate stuff into it (I had a budget of an afternoon to do it). Finally I settled in on JChessBoard. The code was simple and fairly clean, and it was very easy to add the speech recognizer to it. Unfortunately, there were a number of nagging deadlocks caused by race conditions due to some improper updates of swing components. A few calls to SwingUtilities.invokeLater fixed this up though. One really good thing about the JChessBoard app is that the computer AI is pretty poor, so I have a fairly decent chance at beating it.

I still have a bit of tuning to do, but it seems to work pretty well. I'm getting very good recognition rates (using alpha, bravo, charlie for those highly-confusable letters). So I guess I'll have something to demo next week when/if the cool demo doesn't work out.

Comments:

Hi, Could you tell the name and url for the really nice but too hard to figure out how one? I tried JChessBoard, it freezes after the first move. What kind of fixes you have done to it? BTW, I have java 1.4.2_04-b05 loaded. Thanks!

Posted by ct on July 17, 2004 at 03:41 PM EDT #

ct: This one worked well ... http://sourceforge.net/projects/capa/ but, as I said, it was a bit harder to figure out how to integrate the speech stuff. It had a general plug-in architecture which seemed nice and probably given enough time I could have figured out how to easily integrate with it. It seemed to work, had good AI, no hangs. The JChessBoard seems to have lots of race conditions. Throughout the code there are calls to update swing components from non-swing threads (which is a no-no). Also, there is widespread use of nested locking (via synchronized) that combined with the swing issue leads to deadlock. I worked through some of the deadlocks, enough so that I could reliably run the demo, but I think there are many more left. It would probably take some time to root out all the evil.

Posted by Paul on July 17, 2004 at 07:16 PM EDT #

Post a Comment:
Comments are closed for this entry.

This blog copyright 2010 by plamere