A Raptor program can play a wave (.wav) file as it executes. Raptor supports 3 different modes of operation, each selected by a different call. These calls and the associated behaviors are described below. Each of the calls requires a file name as an argument; here are some things to know about the filename argument:
It must be a string expression. In most cases, it will be a string literal surrounded by double quotes (e.g., "laserblast.WAV"), but it can also be a string variable or concatenation of multiple string literals and/or string variables.
It must either include the full path to the wave file (if it isn't in the same directory as the Raptor program), or just the file name (if it is in the same directory as the Raptor program).
The ".WAV" extension at the end of the file name is optional
If the file name is misspelled or otherwise incorrect, the Raptor program will make a warning beep and continue running.
Play_Sound
Play_Sound(filename)
Play_Sound is a call that plays a sound file one time from start to finish. Program execution is paused while the sound is played; no subsequent program symbols are executed until the entire sound file has been played.
Example
Play_Sound("c:\windows\media\Windows XP Startup")
Play_Sound_Background
Play_Sound_Background(filename)
Play_Sound_Background is a call that plays a sound file one time from start to finish. Program execution is NOT paused while the sound is played; the next symbol will be executed once the sound has started. The current sound can be stopped by playing a new sound or waiting until the current sound finishes.
Example
Play_Sound_Background("c:\windows\media\tada.wav")
Play_Sound_Background_Loop
Play_Sound_Background_Loop(filename)
Play_Sound_Background_Loop is a call that plays a sound file repeatedly. Program execution is NOT paused while the sound is played; the next symbol will be executed once the sound has started. The current sound can be stopped only by playing a new sound.
Example
Play_Sound_Background("sound.wav")
Since no path name is given, the file sound.wav must be in the same folder as the program.