Pages

Thursday 24 October 2013

Speech synthesis

I want something to tell me when the number of alerts that my various systems have emailed to me is getting large. I already use the pilite for this; the normal scrolling display is interrupted with a display telling me there's a lot of alert messages. But I might not notice that.

Now I've put up a voice alert. When there's more than 100 messages in the alerts folder, a Raspberry Pi (connected to a speaker) says "There are 100 messages in the alerts" (or whatever the number is). This is the Pi that also drives my scrolling display of time and outside temperature, and whose main job is to run loads of terminals onto various servers.

I did this very simply. I plugged a speaker into the Pi's audio port, and I have a program that loops and looks at the count of messages. When it's more than 100, it does:

espeak -ven+f3 -k5 -s150 -a 1000 "There are $alerts messages in the alerts"

where $alerts is the count of alerts.

There's tons of voices to choose from, including "Ancient greek". Most of the English ones sound pretty much the same to me. The speech synthesis isn't quite Churchillian, but it's easily good enough for this purpose.

No comments:

Post a Comment