GetSoundProperty

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 18:21, 14 March 2013 by AFRLme (talk) (Created page with "<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"> <b>Command History</b> <div class="mw-collapsible-co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Command History

Available since v3.8


Allows you to obtain various property values for the linked sound.id!

Additional Info

Properties currently available:
volume, balance, offset, duration & loop


Syntax:

startSound("filename", {flags=1, properties})


Example:

startSound("sounds/example.ogg")

-- let's store the sound.id into a variable!
local soundID = getSoundId("sounds/example.ogg")

-- let's store the current volume for the linked sound into a variable!
local soundVol = getSoundProperty({flags=1, volume})

-- let's store the current audio balance for the linked sound into a variable!
local soundBal = getSoundProperty({flags=1, balance})

-- let's store the current playtime of the linked sound into a variable!
local soundOffset = getSoundProperty({flags=1, offset})

-- let's store the duration of the linked sound into a variable!
local soundDur = getSoundProperty({flags=1, duration})

--let's store the current loop value of the linked sound into a variable!
local soundLoop = getSoundProperty({flags=1, loop})


Arguments

id: integer (number)
The id for the currently playing audio file! ("sound.id")


Flags

properties

  • volume: returns the volume level of the linked sound.id as an integer value
  • balance: returns the left/right audio balance of the linked sound.id as an integer value
  • offset: returns current playing time of the linked sound.id as an integer value (ms)
  • duration: returns duration of the linked sound.id as an integer value (ms)
  • loop: returns a boolean value of true or false depending on if linked sound.id is set to loop or not


Return see flags (above)


Relevant Pages: getSoundId - setSoundProperty - startSound - stopSound - toggleSoundPause