Summary
There are two steps:
- Change the configuration value for "Announce the time"
- Start/stop the speech synthesis server
The instructions below are for macOS Big Sur.
Configuration value
On macOS Big Sur, the configuration values for "Announce the time" are in the ~/Library/Preferences/com.apple.speech.synthesis.general.prefs.plist
file.
You can view the current state of the file by using the defaults
command:
$ defaults read ~/Library/Preferences/com.apple.speech.synthesis.general.prefs
{
TimeAnnouncementPrefs = {
TimeAnnouncementsEnabled = 0;
TimeAnnouncementsIntervalIdentifier = EveryQuarterHourInterval;
};
}
The TimeAnnouncementPrefs.timeAnnouncementsEnabled
field is a boolean that you can set to enable or disable announcements. You also need the Speech Synthesis Server daemon running, as @mckeed notes.
To enable:
defaults write ~/Library/Preferences/com.apple.speech.synthesis.general.prefs \
TimeAnnouncementPrefs -dict-add TimeAnnouncementsEnabled -bool YES
open /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesisServer.app
To disable:
defaults write ~/Library/Preferences/com.apple.speech.synthesis.general.prefs \
TimeAnnouncementPrefs -dict-add TimeAnnouncementsEnabled -bool NO
Note you need to use -dict-add
and not dict
, otherwise the TimeAnnouncementsIntervalIdentifier
field will get clobbered.
Speech synthesis server
The service name of the speech synthesis server is com.apple.speech.synthesisserver
The specifier in launchctl is:
gui/$UID/com.apple.speech.synthesisserver
where $UID
is your userid (e.g., 501
). The UID
variable should already be set for you by your shell.
Start the speech synthesis server
launchctl kickstart gui/$UID/com.apple.speech.synthesisserver
Stop the speech synthesis server
launchctl kill SIGTERM gui/$UID/com.apple.speech.synthesisserver
(For some reason, I need to run this command twice to stop the process, not sure why).
Check the status of the speech synthesis server
launchctl print gui/$UID/com.apple.speech.synthesisserver