(I've updated this from the old version. Now the spoken text is part of the command line, so there's only one script file).

Sometimes a spoken message is useful. My railway has PM42 power managers to isolate power if a track shorts. A spoken message is a useful way to know where to look for a derailed train.

I've added contact indicators that light up blue if the PM42 zones report a short:

pm42 contact indicators

Contact indicators are assigned to PM42 cells as follows: set the "connection" tab to say LocoNet PM4 power manager sub-district, and set the board number (which you will have programmed with a throttle) nd channel number.

pm42 contact indicator edit

You can then add operations to those contact indicators. Mine displays a message in the Traincontroller message window, and initiates the windows speech engine via a Visual Basic Script (VBS) file:

PM42 short operation

wscript is the program that runs the script. Put the full path to the script in quotes, because it doesn't seem to like paths with spaces in the filenames.

Choose "system operations", cluck "execute" then "add". Click "Change..." and enter the full command line. Mine is:

wscript "C:\Users\Laurence\Documents\south downs railway\rr&co\speech.vbs" "this text is spoken when the track is shorted"

The script file has 4 simple lines of text as follows:

 

Dim speech

Set objArgs = Wscript.Arguments

Set speech=CreateObject("sapi.spvoice")

speech.Speak objargs(0)

 

(the last line tells the script to speak the text presented in the command line text)

There's probably more you can do to change the selected voice etc.... but it's a start!