Tablet UML News


News and commentary (and whatever else catches my eye)
from Martin L. Shoemaker, author of Tablet UML
and UML and Tablet PC instructor for The Richard Hale Shaw Group

Wednesday, April 12, 2006

Vox: A text-to-speech application for keyboard and pen
It looks like I'll be speaking at the Day of .NET in Ann Arbor, MI. And in preparation for that event, the Ann Arbor Computer Society is having a night of Grok Talks on .NET topics, and I was asked to participate. For those who haven't seen them before, a Grok Talk is a quick (ten minutes or less) talk on a small topic, with a focus on demonstrating just a little bit of code or a little technique people can use in their projects. Now normally, I have a bit of Ent in me: ten minutes is scarcely enough time to say good morning. But when I needed to come up with a topic for my Grok Talk and I hadn't enough time to think through it, I said, "Text to speech." And then afterwards, I thought about it, and realized: with Microsoft Speech API (SAPI) 5.1, text-to-speech takes three lines of code. Literally:


ISpVoice mVoice = new SpVoiceClass();
uint uiStream;
mVoice.Speak("Hello, world!", 1, out uiStream);


And one of those lines is a variable declaration! So this topic would take me less than a minute to cover. Whatever would I do with the remaining nine minutes?

So being the Tablet PC guy that I am, I decided to mix in some Ink capabilities as well. So I had a vision of an application that would speak whatever the user writes.

And thus, with some additional thought and design and coding, was born Vox: A text-to-speech application for keyboard and pen; and once I wrote it, I decided to use it as a springboard for discussing Ink and Speech programming under .NET.

Vox is available free to anyone who's interested. I haven't tested it on a non-Tablet PC yet; but it's supposed to work just as well there, because I detect at run time whether the computer has the Tablet PC OS or not, and fall back to non-Tablet mode if not. You can type any message (or write it on a Tablet PC), and Vox will speak the message. It will also remember every message, so that you can repeat a message easily. And it has a user-editable list of Quick Words at the bottom of the form, so that you can tap a word or phrase to say it without writing or typing.

If you like Vox, let me know; and if you would like to learn about the code...