Sound Play
This command plays a sound.
The sound file that is specified must fit into available physical memory and be playable by an installed waveform-audio device driver. If the sound cannot be found, the default system sound is played instead. If the default entry cannot be found, no sound is made and ok_var is set to False.
Syntax
Sound Play file_name, [async], [ok_var]
Synonyms
SD PL
Parameters
The following table describes the parameters of the Sound Play command:
| Parameter | Description |
|---|---|
| file_name | The file name of the sound to be played. |
| async | Set to True if the command should return immediately without waiting for the sound to finish. This is True by default. |
| ok_var | The name of a variable to be set to True if the sound plays correctly. |
Examples
The following example plays the CantAllow.wav sound and waits until it finishes.
* MySoundDir is a variable set to the folder containing the sounds
Sound Play MySoundDir:"CantAllow.wav", False, ok
If ok Then
* Play "OkThen.wav" without waiting for it finish
Sound Play MySoundDir:"OkThen.wav"
EndIfRelated Script Commands
Sound Loop, Sound PlaySystem, Sound Stop
Version
4.1.1 Original