If this blog helped you in any way, please donate a dollar here

Sunday, July 11, 2010

Voice Notification System

Want to make the computer remind you the time every hour, so you don't lose track?

Here's a simple voice (I've chosen a female US speaker for this ;-) notification system that will remind every hour the time.


To install festival:
sudo apt-get install festival


And extract to:

make sure the directory name ends with clunits.

Next, we must make the downloaded voice the default voice.
Edit, festival.scm which is located here:

And append the line:
(set! voice_default 'voice_cmu_us_clb_arctic_clunits)

save the file and now...we are almost done.

Now to configure festival to speak:

Create a file (say, speak.sh) in your $HOME folder, with these contents:
festival --tts <<>

Next, create another file (say sayHourly.sh) in any folder (say at $HOME folder) with the following contents:
if [ `w USERNAME -hos | wc -c` -eq 0 ]; then
tim=`date '+%l %p' | sed 's/AM/A.M/'`;
/home/USERNAME/speak.sh "It is $tim"
(replace USERNAME, with your username)

All set, now to create a cron job that runs your sayHourly.sh every hour. You can customize this to do anything else.

Run: (as yourself)
contab -e

Add this in one line of the file:
0 * * * * /home/USERNAME/sayHourly.sh
Don't forget to replace USERNAME, with your username.

Now we are all done, enjoy the American Girl telling you the time every hour!

No comments:

Post a Comment