Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


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

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.


  • 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.


  1. Install the dependencies (mplayer, weather-util) within your distro.
  2. Edit /etc/mplayer/mplayer.conf and add the following (stops an mplayer error message)


  1. chmod +x the to allow execution (if the permission isn't already set)
  2. Set your location in the file under the # set location section. You can obtain the proper code for your location by visiting or by typing "weather-util [keyword]" (without quotes) in a terminal to search.
  3. Run the ./ script to test
  4. Setup a cronjob via the usual methods


The code for using Google's TTS service came from the following sites.


Time4Pi is a small shell script which speaks the current time and weather via audio output.






No releases published


No packages published