Premise Playing a Wave file for whole house announcements

Motorola Premise

Shinyshoes

Member
I have whole house announcements working using the text to speech module, but my wife would like to have a simple sound effect play when our driveway sensor is tripped. I am able to turn on "page mode" on my Nuvo Grand Concerto so all the zones are on and turned to source 6 (where my computer's sound card is attached) but I can't figure out how to get the wave file to play on the premise server.

Obviously I am very new to scripting in Premise. Could somebody throw me a bone here?

Thanks
Shinyshoes
 
You should be able to modify this from the Premise help file for the 'Comprehensive Example - Security': (one of the others here can give you something that works!)

I assume it would be something like this:

Code:
 If sysevent.newVal =  True Then
schema.Media.Content.FileProvider.DrivewayAlarm.wav.Play = True
End If
 
That's kind of what I was thinking too. I haven't done this before, but you'll need to add the wav file as file provider content (as you do with mp3's and other content), then use a script similar to what Chuck provided.
 
I thought a little later...You need to have the sensor in your home view. You need to have your announcement in the media view. You can make the media announcement 'hidden', so you don't see it when you are looking thru your media in the browser view. Right click on the object "driveway sensor', create 'property change'. Thn you want to add the script from before...'if sysevent.newval = true, then, blah, blah, blah...its relatively easy. After all, I figured it out ;)
 
Thanks for your help guys!

I do have the Driveway sensor in the home view. I don't have the annoucement in media view but I was able to get it to work using the following code:

Code:
if this.floortriggered then
    devices.CustomDevices.ConcertoSystem.ExteriorMute = true
    devices.ComputerAudio.DirectSound_HD_Audio_output.filename = "C:\soundfiles\horn.wav"
    devices.ComputerAudio.DirectSound_HD_Audio_output.play = true

    devices.CustomDevices.ConcertoSystem.ExteriorMute = false
end if

But now the problem is that the "Page Mode" (exteriormute) is only activated for a split second. Obviously I need to add some code to delay the reset of exteriormute to false. I tried using:

Code:
do while not devices.ComputerAudio.DirectSound_HD_Audio_output.progress = 100
loop
but it loops endlessly. I want to try to make this code as re-useable as possible, so I would like to use the length of the sound file being played to set the delay on the reset.

Literally just as I am typing this, it occured to me that I could create a new timer and set the delay for it to run to the length of the sound file. Hmmmmmmmmmm....
 
There's no reliable way to delay using vbscript alone. In Premise there's delay macros you can use (for ms accuracy) and timers (only accurate to the nearest second). DelayMacros also operate differently than timers in that they cause a delay in the execution of your script. Timers will be executed at some point in the future, all the while your script continues to be interpreted by SYS. Since all modules execute in the same thread, you may want to use a timer for the line: devices.CustomDevices.ConcertoSystem.ExteriorMute = false.
 
yeah that is exactly what I did and it seems to have worked for me. I removed the "devices.CustomDevices.ConcertoSystem.ExteriorMute = false" from the script and replaced it with
Code:
system.addtimer devices.ComputerAudio.DirectSound_HD_Audio_output.duration, "devices.CustomDevices.ConcertoSystem.ExteriorMute = false", 1, "EndConcertoExteriorMute"

Problem solved. Thanks everyone for their help. I am SLOWLY learning this beast.
 
Back
Top