Difference between revisions of "SetSoundProperty"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
 
==setSoundProperty==
 
==setSoundProperty==
  
<div class="command-min-version-info">Available since: <span class="command-min-version">v3.8</span></div>
+
<div class="command-min-version-info">Available since: <span class="command-min-version">v4.0</span></div>
  
 
<div class="command-doc">Sets properties of the specified sound.</div>
 
<div class="command-doc">Sets properties of the specified sound.</div>
Line 37: Line 37:
 
setSoundProperty(soundID, {flags=1, volume=80, balance=20}
 
setSoundProperty(soundID, {flags=1, volume=80, balance=20}
 
</syntaxhighlight>
 
</syntaxhighlight>
[[Category:Player Commands]]
 

Revision as of 21:28, 30 September 2014

setSoundProperty

Available since: v4.0
Sets properties of the specified sound.

Lua Syntax:

setSoundProperty(soundID, {flags=1, 
    volume = int, 
    balance = int, 
    loop = true|false, 
    offset = int})

Arguments

soundID

int - ID specifying sound where properties will be set.

Flags

vol/volume

Set sound volume (0 ... mute, 100 ... full volume).

bal/balance

Set sound balance (-100 ... left, 0 ... center, +100 right).

lop/loop

If true then loop sound, otherwise play it only once.

ofs/offset

Set the sound to a specific offset (seek) in milliseconds.

Return Values

status
True if properties were set successfully, false if setting properties failed.

Examples

Example 1:

local soundID = getSoundId('vispath:sounds/example.ogg')

setSoundProperty(soundID, {flags=1, volume=80, balance=20}