Hourly Clock Chime for Mac OS

My current Mac OS (10.9.5) appears to offer only spoken announcements on the hour in any of several voices and languages, including novelty voice sounds like “Zarvox” and “Bubbles.” There seems to be no option to choose default system “Basso,” “Glass,” or similar sounds that are available for Calendar notifications, for example.

The following describes how to enable an hourly chime for Mac OS using some simple scripting with the cron scheduler. This guide assumes familiarity with the command line in Terminal and with being able to locate files and file paths in Mac OS.

Ingredients

  • A sound file, either an existing system sound or one you download
  • Terminal, a Mac OS command-line utility
  • afplay sound player (installed as part of Mac OS)
  • cron job scheduler (installed as part of Mac OS)

Selecting a chime sound

First, locate a sound file you wish to use as your hourly chime. The default Mac system sound files are located at /System/Library/Sounds and include familiar sounds like Basso and Glass. Double-clicking each file should launch and play it for you. There’s no need to move these files from this location.

As an alternative, you might wish to download a sound file more to your liking. One resource for sound files is Freesound.org. Some of the files I considered included:

For downloaded sound files, I would recommend placing them in your home folder under ~/Library/Sounds/, separate from the System sounds.

Testing the sound in Terminal

Launch the Terminal app and test your selected sound using afplay, a command-line sound utility. Any of the following should work.

Editing the cron configuration

Next, we’ll enable a simple text editor in Terminal. The following command sets the default text editor for Terminal to nano.

Once the text editor is set, we can invoke the cron configuration file using the following command.

Enter the following text in the editor and modify the file path to point to your desired sound file. The @hourly macro will simply tell cron to run the command on the hour. The following text should be on one line, entirely on its own.

To exit and save your file (assuming you are using nano), press control-X (to exit), press the Y key to indicate yes (for saving the file), then press Enter to acknowledge the current file as the one you are saving. You will then be returned to the command prompt and your cron event is now scheduled.

Running the chime

There’s nothing more to do. To review the contents of your cron configuration, run the crontab command with the -l option. Otherwise, wait for the top of the hour to hear your chime.

Post script: launchd bug

I had originally attempted to configure a launchd script to perform this very simple task. The launchd command was designed by Apple as a replacement for cron. However, it appears that there’s bug in the StartCalendarInterval parameter that coordinates launchd scripts with the system clock. After wasting too much time searching for a fix and finding too many similar complaints about launchd, I resorted to the cron command. With cron, I spent more time simply deciding on which chime sound I would use.

See this page at https://kinasevych.ca/index.php