SoundObjectPlay(object)
Play a sound object.
void SoundObjectPlay( object oSound );
Parameters
oSound
Sound object to be played.
Description
Play sound object created and placed in module using the Sound Wizard.
Remarks
PlaySound() and SoundObjectPlay() perform different functions. SoundObjectPlay() plays a sound object, which may comprise many sound resources. PlaySound(), in contrast, plays a single sound resource. Sound objects have additional properties as well, such as location and looping characteristics. SoundObjectPlay() may thus be an appropriate choice for controlling area noises, such those associated with OnEnter events.
Note that the sound list of the object is set by default to play at random. So if you have a list of several sounds you want all to play, then go to the Advanced tab of the sound object's properties and change the Play Order to Sequential. If you want it to play at the exact same time, you will need to create multiple sound objects.
Version
1.22
Example
// Placed on the OnEnter event of a generic trigger; // plays a sound object comprising many tavern sounds created with the sound wizard void main() { object oSound = GetObjectByTag("TavernGroup"); SoundObjectPlay(oSound); }
See Also
functions: | AmbientSoundChangeDay | PlaySound | SoundObjectSetVolume | SoundObjectStop |
categories: | Sound Effects Functions |
author: Kristian Markon, editor: Maximus