Geekout

On occasion I even surprise myself. Sometimes you just need to geek. Rob at work was discussing his ideal device, basically something that would read text based RSS feeds to him while in the bath in the morning. Lazy I know.

I thought to myself That cant be too difficult and I’ve never played with any text to speach stuff before and off I went. A few hours later and I just got my Windows machine to read out the top story from this site.

Python is so cool to just hack in. Did I mention that before? I’ve yet to do anything real in it, but playing around with code is nice. Anyway, on with a solution;

Lots of things to install first. As mentioned I used Windows, in this case so I could access the Win32 Speech API. I looked at using Festival on Unix but left that for now. Tools of choice were Python 2.4 with the Win32 extensions. A couple of Python modules do most of the work. First up pyTTS which deals with the text to speach and SAPI integration. Next comes the Feedparser module. I’d heard this mentioned by Simon over on the Yahoo Python developer network and it really is nice.

The rest was easy. import pyTTS import feedparser d = feedparser.parse("http://morethanseven.net/rss") tts = pyTTS.Create() tts.Speak(d['items'][0].description)

Ok, so this isn’t an application. Just a proof of concept but you get the idea and I dont really want or need this app anyway. Why then? because I thought I could. Oh, and Python’s interactive prompt is so cool. I want one for everything.