What is the best way to occasionally play a sound? I have a speaker (Bose SoundLink Mini) connected to my MacBook Pro, and it switches off after periods of non-use. This means that it will shut off even while I am at the computer, if a sound hasn't been played in awhile. What is the most sensible way to have a very quiet (ideally inaudible) sound played every fifteen minutes? I have a little familiarity with AppleScript and am happy to learn more; I don't yet know anything about other scripting methods.
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:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Disabled&lt;/key&gt;
    &lt;false/&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;usr.home.bose.wakeup&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/bin/say&lt;/string&gt;
        &lt;string&gt;wake&lt;/string&gt;
        &lt;string&gt;up&lt;/string&gt;
        &lt;string&gt;you&lt;/string&gt;
        &lt;string&gt;lazy&lt;/string&gt;
        &lt;string&gt;Bose&lt;/string&gt;
        &lt;string&gt;SoundLink&lt;/string&gt;
        &lt;string&gt;Mini&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;StartInterval&lt;/key&gt;
    &lt;integer&gt;887&lt;/integer&gt;
&lt;/dict&gt;
&lt;/plist&gt;

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: 

...
&lt;array&gt;
    &lt;string&gt;/usr/bin/say&lt;/string&gt;
    &lt;string&gt;-v&lt;/string&gt;
    &lt;string&gt;Agnes&lt;/string&gt;
    &lt;string&gt;wake&lt;/string&gt;
...


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):

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Disabled&lt;/key&gt;
    &lt;false/&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;usr.home.bose.wakeup&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/bin/afplay&lt;/string&gt;
        &lt;string&gt;-v&lt;/string&gt;
        &lt;string&gt;0.05&lt;/string&gt;
        &lt;string&gt;/System/Library/Sounds/Submarine.aiff&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;StartInterval&lt;/key&gt;
    &lt;integer&gt;887&lt;/integer&gt;
&lt;/dict&gt;
&lt;/plist&gt;