Thursday, December 08, 2005

News"Reading" in Linux using festival

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.

2 comments:

  1. TThe command is excellent.Your idea of using it with klipper is also great... though I didn't understand completely where I should make the changes like the files and etc.

    ReplyDelete
  2. There is no specific option to do something with files in klipper. You can only use the command option to whatever you want using pipes. To set it
    Right-Click Klipper-> Configure Klipper -> Actions tab -> Add Action button -> Click the latest added action to set the regex and then you can add what do on it by rightclicking the action. I am adding a screenshot in the post.

    ReplyDelete