Time4Pi

Time4Pi is a small shell script which speaks the current time and weather via audio output. It was designed for use on the Raspberry Pi but will work with any Linux machine. It’s intended use is to set it up as a cronjob to speak the time and weather hourly. Obviously you can set it up to run at any interval you like.

The script uses an unofficial call out to Google’s Text to Speech engine as the speech quality is much better than festival or espeak. Output text is sent to Google’s TTS (translate) servers, the response is a speech file which is played back locally via mplayer. Internet connectivity is required because of this dependency on Google’s servers. A sound card, driver, speakers, and mplayer are also required for audio playback.

Weather info is pulled down from NOAA (USA National Oceanic and Atmospheric Administration) via weather-util and as such weather-util is a dependency of this script. NOAA is largely US based it but does contain weather information for some locations outside of the United States. Supported locations can be found at http://weather.noaa.gov

This project is still a work in progress. Sometimes the output from weather-util doesn’t contain the needed info for Time4Pi and as such the weather is said in broken english. I plan on adding proper checks for this info and more configuration options in the future.

Features:

  • Speaks the current time
  • Speaks the current weather (temperature, sky conditions, relitive humidity)
  • Simple, and uses little resources
  • Uses mplayer, weather-util, and Google’s TTS servers.

Download:

Time4Pi can be downloaded from github.
Installation and configuration instructions are also available on github in the README.md file.