Our discussion about how TTS on my mobile phone was a good app compared to the Festival thing in Linux, end up being fruitful. Paresh told me that Festival has matured a lot. My previous experience with Festival was of a being a bad program requiring to much of configuration by user. I was wrong.
Festival 1.4.2 version is the one I am talking about, which comes preinstalled in Fedora Core 3. To listen to some file you can simply use the command
festival --tts file.txt
Some computer generated voice will read the file for you. Not knowing how to use system commands through firefox I came up with better idea. Using KDE/Klipper technology.
What is Klipper: Basically klipper is a enhanced copy/paste buffer provided by KDE. You can program it do certain actions when certain kind of text is selected by mouse. For e.g when you select a email address you will be shown a small context menu kinda thing showing option to send email etc. So here is what I did. (Do explore Klipper for knowing more about it)
1) In klipper I added a new action.
2) The regular expression setting is quite trivial, I simply used \b[\w]+\b etc
3) Note that I have the autopopup disable and have setting up some manual invocation command for klipper actions, ( I have set up Alt+R)
4) Now in the command section I wrote this command
echo %s > ~/temp.txt ; festival -tts ~/temp.txt
Which does obvious stuff.