Sound Operations

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:

 

 

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.