Difference between revisions of "SetSoundProperty"
From The Official Visionaire Studio: Adventure Game Engine Wiki
m |
|||
Line 1: | Line 1: | ||
− | + | ==setSoundProperty== | |
− | |||
− | |||
− | |||
− | |||
+ | <div class="command-min-version-info">Available since: <span class="command-min-version">v3.8</span></div> | ||
− | + | <div class="command-doc">Sets properties of the specified sound.</div> | |
− | <div class=" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | 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==== | ||
− | Example: | + | :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> | <syntaxhighlight> | ||
− | + | local soundID = getSoundId('vispath:sounds/example.ogg') | |
− | local soundID = getSoundId( | ||
− | + | setSoundProperty(soundID, {flags=1, volume=80, balance=20} | |
− | setSoundProperty(soundID, {flags=1, volume= | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 17:12, 22 November 2013
Contents
setSoundProperty
Available since: v3.8
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}