Difference between revisions of "SetSoundProperty"
From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 28: | Line 28: | ||
-- set the linked sound property values to: volume=80%, audio=centered, keep current offset with loop mode on! | -- set the linked sound property values to: volume=80%, audio=centered, keep current offset with loop mode on! | ||
− | setSoundProperty( | + | setSoundProperty(soundID, {flags=1, volume=100, balance=0, offset=0 loop=true}) |
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 17:47, 14 March 2013
Command History
Available since v3.8
Allows you to set various property values for the linked sound.id!
Additional Info
Properties currently available:
volume, balance, offset, loopPlease note that only mono sounds can be panned using the balance property; all stereo channel sounds will remain centered!
Syntax:
setSoundProperty(id, {flags=1, properties})
Example:
-- let's store the sound.id into a variable!
local soundID = getSoundId("sounds/example.ogg")
-- set the linked sound property values to: volume=80%, audio=centered, keep current offset with loop mode on!
setSoundProperty(soundID, {flags=1, volume=100, balance=0, offset=0 loop=true})
Arguments
id: integer (number)
The id for the currently playing audio file! ("sound.id")
Flags
properties
- volume: allows you to set volume level via an integer value
- balance: allows you to set the left/right audio balance via an integer value (-1000/0/1000)
- offset: allows you to start audio file from x time via an integer value (in ms)
- loop: allows you to declare if audio file should loop via a boolean value (true/false)
Return
none
日本語 – 正體中文 – 한국어 – Dansk – Deutsch – English – Español – Français – Italiano – Nederlands – Polski – Português – Svenska – Русский |
Relevant Pages: getSoundId - GetSoundProperty - startSound - stopSound - toggleSoundPause |