PlaySound

From NWN Lexicon



Contents

[edit] PlaySound(string)

Plays a sound on the client machine.

void PlaySound(
    string sSoundName
);

[edit] Parameters

sSoundName

The name of the sound to play.


[edit] Description

Play the wave resource named sSoundName.



[edit] Remarks

PlaySound returns immediately, it does not wait for the sound to finish playing. If you want to play a sound using a trigger, then look at the SoundObjectPlay function, as PlaySound requires an object to work.

This function can play only mono sounds.

Triggers cannot play sounds.


[edit] Known Bugs

This might not be an actual bug, but though PlaySound isn't an action (you don't get the little yellow square on the screen), if you assign a PlaySound to someone, it will wait for their current action queue to finish before playing.


[edit] Version

1.61

[edit] Example

// Placed in the OnUsed event of the an object, for example a gong. The following script will cause a gong ring to sound.
 
main()
{
    PlaySound("as_cv_gongring2");
}

[edit] See Also

functions: 

SoundObjectPlay



 author: Tom Cassiotis, editor: Lilac Soul, additional contributor(s): Lilac Soul
 

Personal tools
Categories