If you are willing to convert the sound to a WAV format, the below works (make sure you update the location of the WAV file on your PC):
_____________________
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Media;
using MLS.ZWave.Service.Rules;
using MLS.ZWave.BusinessObjects;
public class PlayWavFile : ScriptBase, ScriptInterface {
public void runScript() {
try {
string wavFile = @"e:\applause.wav";
SoundPlayer playWav = new SoundPlayer(wavFile);
playWav.Play();
} catch (Exception ex) {
var message = ex.Message;
writeLog(message);
}
}
}
Sound script
- 213 Views
- Last Post 01 February 2014
Your best bet is to wait for the Run File
, GET and POST request integration. Vote here: http://incontrolha.uservoice.com/forums/218427-general/suggestions/5390053-add-actions-to-incontrol-http-get-post-run-file
Thatll be easy to run a sound script from the
Run File`.
Rod
Rod,
Thanks!
If you are willing to convert the sound to a WAV format, the below works (make sure you update the location of the WAV file on your PC):
_____________________
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Media;
using MLS.ZWave.Service.Rules;
using MLS.ZWave.BusinessObjects;
public class PlayWavFile : ScriptBase, ScriptInterface {
public void runScript() {
try {
string wavFile = @"e:\applause.wav";
SoundPlayer playWav = new SoundPlayer(wavFile);
playWav.Play();
} catch (Exception ex) {
var message = ex.Message;
writeLog(message);
}
}
}