I'm unclear exactly what you understand and what you don't based on your post. It reads like you only don't know how to play a file or text to speech, so that's what I'll address.
For text to speech, you can use an action in Indigo using the "Speak" box at the bottom of the action pane in the
action options section - that will speak the value you enter. In Airfoil, you select the
Other Sources->Text to Speech option on the source popup (you can also select that option in the
Change Source action in the Airfoil plugin's action list). So with Airfoil set up like this, any text to speech will be played through Airfoil to the connected speakers.
For a random sound file, you can use the QuickTime Player app to play the sound file. Just select that as the source in Airfoil. Alternately, you can set the source to System Audio (which will play all sounds your Mac makes through the connected Airfoil Speakers) and use the afplay command-line tool from the
Run Shell Script action and point it to your sound file. The Full path to file on server text field would have something like this in it:
- Code: Select all
/usr/bin/afplay /full/path/to/your/sound/file.wav