Say kids, what time is it?

2004/10/06 22:29:00

Some of my older reader might rember the little pyton app I wrote to convert the time into english called talkintime. Well I did what I have been meaning to do for ages tonight.

spd-say `”python talkintime.py”`

Hours of fun…

For those not up with all this tech stuff then the above command runs my talkintime script and uses the output as a command line for the application spd-say. spd-say is a program that reads out whatever you send it using the festival speach engine. So now I have a speaking clock and it is lush.

Only one problem at the moment is that my sound card is so cheap in this laptop that it can’t speak the time while the music is playing .

Update:
Some very crude hacking gives me this script that I think works OK!



#!/bin/sh
RBPLAY=1
if fuser /dev/snd/pcmC0D0p > /dev/null
then
  if ps -ef |grep rhythmbox > /dev/null
  then
   RBPLAY=0
  fi
fi

if [ $RBPLAY -eq 0 ]
then
   rhythmbox --play-pause
fi
cd /home/john/bin
spd-say "`python talkintime.py`"
sleep 5
if [ $RBPLAY -eq 0 ]
then
   rhythmbox --play-pause
fi

Listen to this podcast Listen to this podcast