Sound

Handle Wrappers View source
Sound

Returns sound length in milliseconds.

Beware that sound lengths of game assets may differ between different locales,
and thus return a different duration.
If you use a async duration in a synced manner, it will cause a desync.

Source on GitHub

Extension Functions

sound.setDuration

public function sound.setDuration(int dur)

Sets the sound duration in milliseconds

sound.play

public function sound.play()

sound.stop

public function sound.stop(boolean killWhenDone, boolean fadeOut)

sound.setChannel

public function sound.setChannel(int channel)

sound.setPitch

public function sound.setPitch(real pitch)

sound.setVolume

public function sound.setVolume(int volume)

Sets the sound’s volume [0-100]

sound.setConeAngles

public function sound.setConeAngles(real inside, real outside, int outsideVolume)

sound.setCutoff

public function sound.setCutoff(real cutoff)

sound.playPosition

public function sound.playPosition(int millisecs)

Plays the sound, starting at the given position

sound.getDuration

public function sound.getDuration() returns int

sound.isPlaying

public function sound.isPlaying() returns boolean

sound.triggerWaitForSound

public function sound.triggerWaitForSound(real offset)

sound.setSoundParamsFromLabel

public function sound.setSoundParamsFromLabel(string soundLabel)

sound.setSoundDistances

public function sound.setSoundDistances(real minDist, real maxDist)

sound.setSoundConeOrientation

public function sound.setSoundConeOrientation(real x, real y, real z)

sound.setSoundPosition

public function sound.setSoundPosition(real x, real y, real z)

sound.setSoundVelocity

public function sound.setSoundVelocity(real x, real y, real z)

sound.attachSoundToUnit

public function sound.attachSoundToUnit(unit whichUnit)

sound.startSoundEx

public function sound.startSoundEx(boolean fadeIn)

sound.registerStackedSound

public function sound.registerStackedSound(boolean byPosition, real rectwidth, real rectheight)

sound.unregisterStackedSound

public function sound.unregisterStackedSound(boolean byPosition, real rectwidth, real rectheight)

sound.setSoundFacialAnimationLabel

public function sound.setSoundFacialAnimationLabel(string animationLabel) returns boolean

sound.setSoundFacialAnimationGroupLabel

public function sound.setSoundFacialAnimationGroupLabel(string groupLabel) returns boolean

sound.setSoundFacialAnimationSetFilepath

public function sound.setSoundFacialAnimationSetFilepath(string animationSetFilepath) returns boolean

sound.setDialogueSpeakerNameKey

public function sound.setDialogueSpeakerNameKey(string speakerName) returns boolean

sound.setDialogueTextKey

public function sound.setDialogueTextKey(string dialogueText) returns boolean