TN IT189 Play a sound file with InTouch Scripting
Often you will want to play a sound file from InTouch to alert a user to an event.
- Author: Dillon Perera
- Published: 12/30/2015
- Applies to: InTouch 10.0 and up
From InTouch the PlaySound() function can be used to play a .wav file.
The general syntax is:
PlaySound ("PathAndFile", HowToPlay);
The PathAndFile would be the location of the .wav file that you would like to play, for example "C:\alert.wav".
The HowToPlay parameter determines how long the file should be played for.
0 - Plays the file one time synchronously, meaning the software will sit and wait for the file to finish playing.
1 - Plays the file one time asynchronously, meaning it will play once, but the software will continue working while the file is playing.
9 - Plays the file continuously until the PlaySound() function is called again.
With option 9, you can stop the playing by running a blank sound file, such as in the following: