From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 22:27, 30 September 2014 by Vis apiuser (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Available since: v4.0
Return the requested sound property

Lua Syntax:

getSoundProperty(soundID, property)



int - ID of sound to get property from.


"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).


Return Values

requested property value.


Example 1: store the current playtime of a sound

local soundID = getSoundId('vispath:sounds/example.ogg')
local soundOffset = getSoundProperty(soundID, "offset")