void DoSound(number subFunction, ...)
Do sound handles all sound related functions such as playing, loading, unloading, stopping, pausing, etc. It uses the first parameter to identify it's subfunction, and the following parameters vary.
void DoSound(sndINIT, heapPtr sndObject)Sets up the specified sound object. It loads the sound resource specified by the sound object's number property and sets it's status property to ssINITIALIZED.ExampleDoSound(sndINIT aSoundObject)void DoSound(sndPLAY, heapPtr sndObject)Plays the sound specified by the given sound object and sets the object's status property to sndPLAYING.ExampleDoSound(sndPLAY aSoundObject)void DoSound(sndDISPOSE, heapPtr sndObject)Disposes of the sound specified by the given object unloading it and removing it from the sound system.ExampleDoSound(sndDISPOSE aSoundObject)bool DoSound(sndSET_SOUND[, bool fTURN_ON])If the sound system is currently muted, it returns FALSE, otherwise, it returns TRUE.
If fTURN_ON is specified, it evaluates it and sets whether to mute or unmute the sound system. If it is TRUE, the sound system it unmuted. If it is FALSE, the sound system is muted.Example// If the sound system is not muted, mute it.
)void DoSound(sndSTOP, heapPtr sndObject)Stops playing the sound specified by the given sound object and sets the object's status property to sndSTOPPED.ExampleDoSound(sndSTOP aSoundObject)void DoSound(sndPAUSE, heapPtr sndObject)Pauses the sound specified by the given sound object and sets the object's status property to ssPAUSED.ExampleDoSound(sndPAUSE aSoundObject)void DoSound(sndRESUME, heapPtr sndObject)Resumes playing a previously paysed sound and sets it's status to sndPLAYING.ExampleDoSound(sndRESUME aSoundObject)number DoSound(sndVOLUME[, number newVolume])Returns the currently set sound volume, which is a number ranging from 0 to 15.If newVolume is specified, it sets the volume to newVol.Example(if(< DoSound(sndVOLUME) 7)
)void DoSound(sndUPDATE, heapPtr sndObject)Tells the sound system to update the specified sound. It notifies it that the sound has changed so it's priority and loop properties are reevaluated.ExampleDoSound(sndUPDATE aSoundObject)void DoSound(sndFADE, heapPtr sndObject)Fades the specified sound for roughly two seconds, then stops it, setting it's status property to ssSTOPPED.ExampleDoSound(sndFADE aSoundObject)bool DoSound(sndCHECK_DRIVER)Checks to see if the sound driver is installed. If it is, it returns TRUE, otherwise, it returns FALSE.Example(if( not DoSound(sndCHECK_DRIVER) )
Print("The sound driver is not installed!")
)void DoSound(sndSTOP_ALL)Stops all the sounds currently playing.ExampleDoSound(sndSTOP_ALL)