Thursday May 24, 2007
Application for Finding and Reciting Shakespeare
Roumen told me about Tor using FreeTTS during one of his presentations at JavaOne. It is a free open source speech synthesizer. In Java. I combined a small code snippet (thanks Roumen), with this web service (which I blogged about a lot about a year ago):
http://www.xmlme.com/WSShakespeare.asmx
And now, as a result, I need never read Shakespeare again. Why? Because my application reads it for me. Here's the simple user interface:

First, I click Fetch, then the snippet is sent to the web service and the text area is populated with a large chunk of Shakespeare, based on my search string. Then, I click Read, and the content of the text area is recited. It's pretty cool to hear the result being recited, especially when punctuated by "slash speech". Nice computereeze ending to a Shakespearean snippet...
Here's the code under the Read button:
VoiceManager voiceManager = VoiceManager.getInstance();
Voice helloVoice = voiceManager.getVoice("kevin16");
String text = jTextArea1.getText();
helloVoice.allocate();
helloVoice.speak(text);
helloVoice.deallocate();
Shakespeare must be rolling in his grave. That it should come to this, his wisdom being mangled with XML tags, robotized by a computer voice named "kevin16". Still, though, significantly better than some live performances I've seen.
May 24 2007, 10:34:29 AM PDT Permalink


