Difference between revisions of "SetSoundProperty"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Redirected page to Global Command: setSoundProperty)
 
Line 1: Line 1:
==setSoundProperty==
+
#REDIRECT [[Global Command: setSoundProperty]]
 
 
<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>
 
 
 
Lua Syntax:
 
<pre class="command-syntax">setSoundProperty(soundID, {flags=1,
 
    volume = int,
 
    balance = int,
 
    loop = true|false,
 
    offset = int})</pre>
 
===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:
 
<syntaxhighlight>
 
local soundID = getSoundId('vispath:sounds/example.ogg')
 
 
 
setSoundProperty(soundID, {flags=1, volume=80, balance=20}
 
</syntaxhighlight>
 

Latest revision as of 12:31, 19 May 2023