SetInstanceVolume - Sound

From the CreationKit Wiki
Jump to navigation Jump to search

Member of: Sound Script

Modify the volume of a playing sound instance.

Syntax[edit | edit source]

Function SetInstanceVolume(int aiInstanceID, float afVolume) native global

Parameters[edit | edit source]

  • iInstanceID: The instance ID of the sound whose playback volume we wish to modify.
  • afVolume: The desired volume of a playing sound instance. Values outside of 0.0 - 1.0 will be clamped.

Return Value[edit | edit source]

None.

Examples[edit | edit source]

int instanceID = mySFX.play(self)          ; play mySFX sound from my self
Sound.SetInstanceVolume(instanceID, 0.5)   ; play at half volume

See Also[edit | edit source]