Difference between revisions of "GetSoundProperty"
From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: | Line 1: | ||
− | + | ==getSoundProperty== | |
− | |||
− | |||
− | |||
− | |||
+ | <div class="command-min-version-info">Available since: <span class="command-min-version">v3.8</span></div> | ||
− | + | <div class="command-doc">Return the requested sound property</div> | |
− | <div class=" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Lua Syntax: | |
− | Syntax: | + | <pre class="command-syntax">getSoundProperty(soundID, property)</pre> |
− | < | + | ===Arguments=== |
− | + | ====soundID==== | |
− | + | :'''int''' - ID of sound to get property from. | |
− | + | ====property==== | |
− | + | :'''"string"''' - Property to retrieve.Currently supported properties: "volume" (0 mute ... 100 full volume, -1 if volume could not be retrieved), "balance" (-100 ... left, 0 ... center, +100 ... right, 0 if balance could not be retrieved), "offset" (current position from beginning of the sound in milliseconds, -1 if offset could not be retrieved), "duration" (total duration of sound in milliseconds, -1 if duration could not be retrieved), "loop" (true if sound is looped, false it is only played once, false if loop property could not be retrieved), "playing" (true if sound is currently playing, false otherwise)."paused" (true if sound is currently paused, false if sound is playing or not active at all). | |
− | Example: | + | ===Flags=== |
+ | ===Return Values=== | ||
+ | ;property | ||
+ | :requested property value. | ||
+ | ===Examples=== | ||
+ | Example 1: store the current playtime of a sound | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | + | local soundID = getSoundId('vispath:sounds/example.ogg') | |
− | local soundID = getSoundId( | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
local soundOffset = getSoundProperty(soundID, "offset") | local soundOffset = getSoundProperty(soundID, "offset") | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 17:11, 22 November 2013
Contents
getSoundProperty
Available since: v3.8
Return the requested sound property
Lua Syntax:
getSoundProperty(soundID, property)
Arguments
soundID
- int - ID of sound to get property from.
property
- "string" - Property to retrieve.Currently supported properties: "volume" (0 mute ... 100 full volume, -1 if volume could not be retrieved), "balance" (-100 ... left, 0 ... center, +100 ... right, 0 if balance could not be retrieved), "offset" (current position from beginning of the sound in milliseconds, -1 if offset could not be retrieved), "duration" (total duration of sound in milliseconds, -1 if duration could not be retrieved), "loop" (true if sound is looped, false it is only played once, false if loop property could not be retrieved), "playing" (true if sound is currently playing, false otherwise)."paused" (true if sound is currently paused, false if sound is playing or not active at all).
Flags
Return Values
- property
- requested property value.
Examples
Example 1: store the current playtime of a sound
local soundID = getSoundId('vispath:sounds/example.ogg')
local soundOffset = getSoundProperty(soundID, "offset")