What is the best way to occasionally play a sound?
Simply create a launch agent which repeatedly says something (or plays a sound) and load it:
-
Create a plist with nano in Terminal:
nano ~/Library/LaunchAgent/usr.home.bose.wakeup.plist
-
Copy the following lines and paste it into the Terminal window:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Disabled</key> <false/> <key>Label</key> <string>usr.home.bose.wakeup</string> <key>ProgramArguments</key> <array> <string>/usr/bin/say</string> <string>wake</string> <string>up</string> <string>you</string> <string>lazy</string> <string>Bose</string> <string>SoundLink</string> <string>Mini</string> </array> <key>RunAtLoad</key> <true/> <key>StartInterval</key> <integer>887</integer> </dict> </plist>
Save the file with ctrlO and exit nano with ctrlX
-
Load the plist with:
launchctl load ~/Library/LaunchAgent/usr.home.bose.wakeup.plist
You can use other voices by adding the option -v $VOICE
. To get the list of all available voices enter say -v ?
in Terminal.
Example:
...
<array>
<string>/usr/bin/say</string>
<string>-v</string>
<string>Agnes</string>
<string>wake</string>
...
The downside of say
: you can't set a sound level!
Therefore an alternative launch agent with afplay
instead (you can set the sound level with the -v option):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>usr.home.bose.wakeup</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/afplay</string>
<string>-v</string>
<string>0.05</string>
<string>/System/Library/Sounds/Submarine.aiff</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>887</integer>
</dict>
</plist>
For this specific speaker, it turns out there is an easier answer: just press and hold the bluetooth and + buttons until it verifies that auto-off has been disabled. Still, thank you all for the input!