StopInstance - Sound

From the CreationKit Wiki
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]