PlayWaveForm

Plays a WAV sound file.

Syntax:

PlayWaveForm (filename, mode)

Parameters:

(s) filename name of the WAV sound file.

(i) mode play mode (see below).

Returns:

(i)  @TRUE if successful; @FALSE if unsuccessful.

 

If Windows multimedia sound extensions are present, and waveform-compatible hardware is installed, this function will play a WAV sound file. If "filename" is not in the current directory and a directory is not specified, the path will be searched to find the file. If "filename" is not found, the WAV file associated with the "SystemDefault" keyword is played, (unless the "NoDefault" setting is on).

Instead of specifying an actual filename, you may specify a keyword name from the [Sound] section of the WIN.INI file (e.g., "SystemStart"), or equivalent Registry key, in which case the WAV file associated with that keyword name will be played.

"Mode" is a bitmask, composed of the following bits:

Mode 

Meaning

0

Wait for the sound to end before continuing.

1

Don't wait for the sound to end. Start the sound and immediately process more statements.

2

If sound file not found, do not play a default sound

9

Continue playing the sound forever, or until a PlayWaveForm(" ", 0) statement is executed

16

If another sound is already playing, do not interrupt it. Just ignore this PlayWaveForm request.

 

You can combine these bits using the binary OR operator.

The command PlayWaveForm(" ", 0) can be used at any time to stop sound.

Examples:
PlayWaveform("tada.wav", 0)
PlayWaveform("SystemDefault", 1 | 16)
Message("PlayWaveForm","Done.")
See Also:

Beep, PlayMedia, PlayMidi, Sounds