Friday, September 28, 2012

Easy read out loud in linux

1. Install espeak and xclip
2. Create the following script
vim /opt/myapps/read_out_loud.sh

#!/bin/bash
pidof espeak
if [[ $? == 0 ]]
then
   pkill -9 espeak
else
   TEXT=$( xclip -o | sed s/\"/\'/g )
   espeak -ven+f2 -s180 "$TEXT"
fi


3. Add keyboard short-cut to the script  (eg: Ctrl+Shift+r)
4. To read any text, first copy the text (eg: Select and Press Ctrl+c) and the press Ctrl+Shift+r. This will read the text in the clipboard.

No comments:

Post a Comment