I use a Vaux Vaux 1600A-LE-02 Audio Matrix switch with a home run WHA setup and central WHA amp. The Vaux is very nice and can be occasionally found on ebay for a few hundred bucks. The later models have a built in paging function which, when executed via an applescript, saves all levels and inputs then switches to whatever paging input is specified, makes the announcement and switched back. The whole thing is RS232 controllable. Very easy.
- Code: Select all
tell application "iTunes"
pause
pause
end tell
delay 1.5
--set Vaux to paging state. There are several states that can be called and do what ever is programmed re zones, volume, etc. This one plays a doorbell ring outside, so all zones are enabled. It just as easily plays a phrase via iTunes.
tell application "Serial Bridge"
set connectionName to "Vaux"
send to source connectionName string "*cw,91,1,0,0,1
"
end tell
--delay 1
--execute sound file; first get computer output volume so it can be restored
set original_volume to output volume of (get volume settings)
set volume output volume 100
do shell script "afplay '/Users/WilliamsEC/sounds/doorbell.wav' "
set volume output volume original_volume
--exit Paging State
tell application "Serial Bridge"
set connectionName to "Vaux"
send to source connectionName string "*cw,91,1,0,0,0
"
end tell
delay 1
tell application "iTunes"
play
end tell
The other way I did it is is to store the current values as variables in a script. Not as elegant as the preceding ones or as simple as paging but worked well:
- Code: Select all
tell application "iTunes"
activate
end tell
tell application "IndigoServer"
set currentAudioSourceZone1 to value of variable "audio_1_source"
set currentAudioSourceZone2 to value of variable "audio_2_source"
set currentAudioSourceZone3 to value of variable "audio_3_source"
set currentAudioSourceZone4 to value of variable "audio_4_source"
set currentAudioSourceZone5 to value of variable "audio_5_source"
set currentAudioSourceZone6 to value of variable "audio_6_source"
set currentAudioSourceZone7 to value of variable "audio_7_source"
set currentAudioSourceZone8 to value of variable "audio_8_source"
set currentAudioSourceVolume1 to value of variable "audio_1_volume"
set currentAudioSourceVolume2 to value of variable "audio_2_volume"
set currentAudioSourceVolume3 to value of variable "audio_3_volume"
set currentAudioSourceVolume4 to value of variable "audio_4_volume"
set currentAudioSourceVolume5 to value of variable "audio_5_volume"
set currentAudioSourceVolume6 to value of variable "audio_6_volume"
set currentAudioSourceVolume7 to value of variable "audio_7_volume"
set currentAudioSourceVolume8 to value of variable "audio_8_volume"
set iTunesCurrentState to value of variable "iTunes_CurrentlyPlaying" as string
set currentGirlsAlarmAudio to value of variable "airfoilSpeaker3"
set currentDaddysiMac to value of variable "airfoilSpeaker4"
end tell
tell application "Airfoil"
connect to (every speaker whose name is "Girls' Alarm Audio")
set aSource to first system source
set current audio source to aSource
end tell
tell application "IndigoServer"
set value of variable "KidsOutlets" to "true"
set value of variable "airfoilSpeaker3" to "true"
set value of variable "airfoilSpeaker4" to "true"
set value of variable "airfoilSpeaker3" to "true"
iTunesPause()
set value of variable "audio_1_source" to "2" as string
set value of variable "audio_2_source" to "2" as string
set value of variable "audio_3_source" to "2" as string
set value of variable "audio_4_source" to "2" as string
set value of variable "audio_5_source" to "2" as string
set value of variable "audio_6_source" to "2" as string
set value of variable "audio_7_source" to "2" as string
set value of variable "audio_8_source" to "2" as string
set value of variable "audio_1_volume" to "30" as string
set value of variable "audio_2_volume" to "30" as string
set value of variable "audio_3_volume" to "30" as string
set value of variable "audio_4_volume" to "30" as string
set value of variable "audio_5_volume" to "30" as string
set value of variable "audio_6_volume" to "30" as string
set value of variable "audio_7_volume" to "30" as string
set value of variable "audio_8_volume" to "30" as string
delay 3
set iTunesSpeech to value of variable "TextToSpeech" as string
end tell
tell application "iTunes"
pause
say iTunesSpeech
end tell
delay 3
tell application "IndigoServer"
set value of variable "audio_1_volume" to currentAudioSourceVolume1 as string
set value of variable "audio_2_volume" to currentAudioSourceVolume1 as string
set value of variable "audio_3_volume" to currentAudioSourceVolume1 as string
set value of variable "audio_4_volume" to currentAudioSourceVolume1 as string
set value of variable "audio_5_volume" to currentAudioSourceVolume1 as string
set value of variable "audio_6_volume" to currentAudioSourceVolume1 as string
set value of variable "audio_7_volume" to currentAudioSourceVolume1 as string
set value of variable "audio_8_volume" to currentAudioSourceVolume1 as string
set value of variable "audio_1_source" to currentAudioSourceZone1 as string
set value of variable "audio_2_source" to currentAudioSourceZone2 as string
set value of variable "audio_3_source" to currentAudioSourceZone3 as string
set value of variable "audio_4_source" to currentAudioSourceZone4 as string
set value of variable "audio_5_source" to currentAudioSourceZone5 as string
set value of variable "audio_6_source" to currentAudioSourceZone6 as string
set value of variable "audio_7_source" to currentAudioSourceZone7 as string
set value of variable "audio_8_source" to currentAudioSourceZone8 as string
set value of variable "airfoilSpeaker3" to currentGirlsAlarmAudio as string
set value of variable "airfoilSpeaker4" to currentDaddysiMac as string
delay 5
tell application "IndigoServer"
if iTunesCurrentState is "true" then
tell application "iTunes"
play
end tell
end if
end tell
--set value of variable "KidsOutlets" to "false"
--execute group "KidsOutletsOFF Disconnect Airfoil"
end tell