- Posted on
Mon Jul 01, 2019 11:05 pm
-
nsheldon
offline
-
- Posts: 2469
- Joined: Aug 09, 2010
- Location: CA
-
Hi shapa.
Thanks for the reminder. @Jay: Thanks for the scripting tips too.
The primary reasons for relying on Play Sound with the Announcer plugin, as opposed to using basic command-line "say" functionality or macOS API calls were 1) Play Sound is multi-threaded. It can play multiple audio streams simultaneously which is perfect if you want to have background "ambiance" to play behind the spoken announcement. You can't do that with the "say" command. I'm not at all familiar with the macOS API. Perhaps that can be done using that method, though it'd probably require a fair bit of work to implement. And 2) Play Sound audio output can be hijacked by AirFoil and sent to any number of AirPlay speakers simultaneously. This is also the reason for the "Use Specific Copy of Play Sound" option in that dialog. By having multiple copies of Play Sound running, you can actually have multiple simultaneous announcements playing at once all being sent to different AirPlay speakers. I believe the "say" command uses the same macOS API calls to generate the audio, which means that in order for AirFoil to send the output to another speaker, it'd have to send all system audio to the other speaker, not just the output produced by Announcer.
In any case, I'll see what I can come up with, but unfortunately, the Play Sound developer has been long absent with no trace of the original code and no equivalent, at least of which I'm aware. If I can't find a solution, the options are to either discontinue the Announcer plugin or severely handicap its functionality, rendering it no more useful than the built-in "Speak" option found at the bottom of all Indigo event settings. (No disparagement toward that feature intended).