House announcement system – Text to speech on events

My wireless doorbell project was a huge success. But it got me thinking that all these events I’m capturing from sensors around the house should be good to listen to as they happen, not just the doorbell.

Time for some text-to-speech, like this

It turns out that Ubuntu has a really great text-to-speech engine called festival.

Install it :

sudo apt-get install festival

Now you can call it from the command line:

echo hello | festival --tts

… and it says “hello” through the speakers. Amazingly simple.

Events detected in the house are routed to my message broker, which allows scripts to subscribe to topics. The topics are organised into a hierarchy/onthology like this:

/house/study/temperature

or

/house/porch/doorbell

Now if I want these to be read out loud, we just have to discard the /house/ part, and any other “/” separators, and the events can be read-out by festival like “study temperature”.

The events each carry a value, like “18.5”, so when that gets read out we hear “study temperature eighteen point five”.

Of course, it gets on your nerves eventually, but I think for unusual events which are not logged frequently it would be good to hear them.

Even for my internet-enabled bell in the study it is proving useful. When the bell goes off, the server says “study bell ring from internet” because my PHP script publishes to event “/house/study/bell” a value of “ring from internet”, whereas normal bell rings from the front door just say something different.

Script which does this is here

It’s a bit fragile, doesn’t handle failures in the connection to the broker yet, and should really be using the –server option of festival, but it shows the idea I think.

 

 

Advertisements
This entry was posted in Computing and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s