|
|
(5 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | <div class="toccolours mw-collapsible mw-collapsed tbl-ds">
| + | #REDIRECT [[Global Command: setSoundProperty]] |
− | <span class="bold">Command History</span>
| |
− | <div class="mw-collapsible-content">
| |
− | <div class="alt-bg">Available since v3.8</div>
| |
− | </div></div>
| |
− | | |
− | | |
− | Allows you to set various property values for the linked sound.id!
| |
− | <div class="toccolours mw-collapsible mw-collapsed tbl-ds">
| |
− | <span>Additional Info</span>
| |
− | <div class="mw-collapsible-content">
| |
− | <div>Properties currently available:
| |
− | <pre>volume, balance, offset, duration & loop</pre>
| |
− | Please note that only mono sounds can be panned using the balance property; all stereo channel sounds will remain centered!</div>
| |
− | </div></div>
| |
− | | |
− | | |
− | Syntax:
| |
− | <syntaxhighlight>
| |
− | setSoundProperty(id, {flags=1, properties})
| |
− | </syntaxhighlight>
| |
− | | |
− | | |
− | Example:
| |
− | <syntaxhighlight>
| |
− | -- 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}) | |
− | </syntaxhighlight>
| |
− | | |
− | | |
− | | |
− | <span class="bold underline">Arguments</span>
| |
− | | |
− | <span class="bold">id</span>: integer (number) <br/>
| |
− | The id for the currently playing audio file! ("sound.id")
| |
− | | |
− | | |
− | <span class="bold underline">Flags</span>
| |
− | | |
− | <span class="bold">properties</span>
| |
− | * 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)
| |
− | | |
− | | |
− | <span class="bold underline">Return</span>
| |
− | | |
− | none
| |
− | {{i18n|GetSoundProperty}} <br/>
| |
− | {| class="tbl-ds"
| |
− | |-
| |
− | |<span class="bold">Relevant Pages</span>: [[GetSoundId|getSoundId]] - [[GetSoundProperty|GetSoundProperty]] - [[StartSound|startSound]] - [[StopSound|stopSound]] - [[ToggleSoundPause|toggleSoundPause]]
| |
− | |}
| |