StopInstance - Sound

From the CreationKit Wiki
Revision as of 03:58, 20 May 2015 by imported>Antares (Article Creation. Hope I did ok)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Member of: Sound Script

Cause the given playback instance to cease playback. The next time the sound is played it will have a new instance ID.

Syntax[edit | edit source]

Function StopInstance(Int aiInstanceID) native global

Parameters[edit | edit source]

  • aiIstanceID: The integer value of the sound you wish to manipulate.

Examples[edit | edit source]

Int instanceID

Event OnEffectStart(Actor akTarget, Actor akCaster)

  instanceID = mySFX.play(akTarget)          ; play mySFX sound from the akTarget

EndEvent


Event OnEffectFinish(Actor akTarget, Actor akCaster)

  Sound.StopInstance(instanceID)             ; stop the instanceID sound effect

EndEvent

Notes[edit | edit source]

  • This function is very useful if you wish to dynamically control the duration of a looping sound effect

See Also[edit | edit source]