Sound Script: Difference between revisions

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rhavlovick
m (1 revision: Clobber re-import by Henning)
 
m (Convert source tags to syntaxhighlight)
 
(6 intermediate revisions by 3 users not shown)
Line 8: Line 8:


== Definition ==
== Definition ==
<source lang="papyrus">
<syntaxhighlight lang="papyrus">
ScriptName Sound extends Form
ScriptName Sound extends Form
</source>
</syntaxhighlight>


== Properties ==
== Properties ==
None
None


== Global Functions ==
== Global Functions ==
*Function [[SetInstanceVolume - Sound|SetInstanceVolume]](int aiInstanceID, float afVolume)
 
**Modify the volume of a playing sound instance. Values outside of 0.0 - 1.0 will be clamped.
:'''[[SetInstanceVolume - Sound|SetInstanceVolume]](Int ''aiInstanceID'', Float ''afVolume'')'''
*Function [[StopInstance- Sound|StopInstance]](int aiInstanceID)
:*Modify the volume of a playing sound instance. Values outside of 0.0 - 1.0 will be clamped.
**Cause the given playback instance to cease playback. The next time the sound is played it will have a new instance ID.
 
:'''[[StopInstance - Sound|StopInstance]](Int ''aiInstanceID'')'''
:*Cause the given playback instance to cease playback. The next time the sound is played it will have a new instance ID.
 


== Member Functions ==
== Member Functions ==
*int Function [[Play - Sound|Play]](ObjectReference akSource)
 
**Plays this sound from the specified source object. The returned integer is the playback instance ID, which can be used to control the sound after it has been started.
:'''Int [[Play - Sound|Play]](ObjectReference ''akSource'')'''
*bool Function [[PlayAndWait - Sound|PlayAndWait]](ObjectReference akSource)
:*Plays this sound from the specified source object. The returned integer is the playback instance ID, which can be used to control the sound after it has been started.
**Plays this sound from the source object, and waits for the sound to finish.
 
:'''Bool [[PlayAndWait - Sound|PlayAndWait]](ObjectReference ''akSource'')'''
:*Plays this sound from the source object, and waits for the sound to finish.
 
 
== SKSE Member Functions ==
 
:'''SoundDescriptor [[GetDescriptor - Sound|GetDescriptor]]()'''
:*Returns the [[Sound Descriptor]] of the Sound.


== Events ==
== Events ==
None
None

Latest revision as of 20:22, 5 September 2026


Extends: Form Script (Papyrus)

Script for the manipulation of sound base objects.

Definition[edit | edit source]

ScriptName Sound extends Form

Properties[edit | edit source]

None


Global Functions[edit | edit source]

SetInstanceVolume(Int aiInstanceID, Float afVolume)
  • Modify the volume of a playing sound instance. Values outside of 0.0 - 1.0 will be clamped.
StopInstance(Int aiInstanceID)
  • Cause the given playback instance to cease playback. The next time the sound is played it will have a new instance ID.


Member Functions[edit | edit source]

Int Play(ObjectReference akSource)
  • Plays this sound from the specified source object. The returned integer is the playback instance ID, which can be used to control the sound after it has been started.
Bool PlayAndWait(ObjectReference akSource)
  • Plays this sound from the source object, and waits for the sound to finish.


SKSE Member Functions[edit | edit source]

SoundDescriptor GetDescriptor()

Events[edit | edit source]

None