WIN$PLAYSOUND
The WIN$PLAYSOUND library routine plays a ".wav" or a ".aiff" file.
Syntax:
 CALL "WIN$PLAYSOUND" USING soundName 
                            soundFlags
                     GIVING returnCode
Parameters:
soundName
PIC X(n)
Specifies the name of the file to be played. It can be any .WAV or .AIFF file. If soundName is spaces, any sound currently playing is stopped.
soundFlags
any numeric data item or numeric literal
It affects the way the sound is played. Valid values, defined in isgui.def, are:
 
SND-SYNC
The execution of the program is suspended for the whole duration of the sound.
SND-ASYNC
The sound is played asynchronously.
Return code:
returnCode can be any signed numeric data item and provides additional information:
-1
The WIN$PLAYSOUND library routine is not supported.
0
Operation failed.
1
Operation successful.
Examples:
Example - Play a sound file synchronously
*> on working-storage copy "isgui.def"
*> snd-filename is pic x(n)
 
move "c:\tmp\sounds\startsound.wav" to snd-filename
call "win$playsound" using snd-filename, snd-sync