Difference between revisions of "GetSoundId (CMS)"
From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed tbl-ds"> <span class="bold">Command History</span> <div class="mw-collapsible-content"> <div class="alt-bg">Available since ...") |
m (Text replacement - "{{toc}}" to "") |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {| class="toccolours mw-collapsible mw-collapsed ts" | |
− | + | |- | |
− | + | ! Function History | |
− | + | |- | |
− | + | | Available since v4.0 | |
+ | |} | ||
− | Use this to store the sound.id for an audio file into a variable; which you can use to stop/pause/resume or edit the linked sounds properties | + | Use this to store the sound.id for an audio file into a variable; which you can use to stop/pause/resume or edit the linked sounds properties. |
Line 15: | Line 16: | ||
+ | Example: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | -- let's store the sound ID into a variable for later use | + | -- let's store the sound ID into a variable for later use |
− | local soundID = getSoundId("sounds/example.ogg") | + | local soundID = getSoundId("vispath:sounds/example.ogg") |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 25: | Line 27: | ||
<span class="bold">filename</span>: path <br/> | <span class="bold">filename</span>: path <br/> | ||
− | The path to the audio file whose ID we want to obtain | + | The path to the audio file whose ID we want to obtain; '''vispath:''' must be included at the beginning of the path. |
+ | <syntaxhighlight>"vispath:path/filename.type"</syntaxhighlight> | ||
Line 37: | Line 40: | ||
<span class="bold">id</span> <br/> | <span class="bold">id</span> <br/> | ||
Returns the sound ID as an integer value. | Returns the sound ID as an integer value. | ||
− | + | <br/> | |
− | {| class=" | + | {| class="ts" |
|- | |- | ||
− | | | + | | '''Relevant Pages''': [[GetSoundProperty_(CMS)|getSoundProperty]] - [[SetSoundProperty_(CMS)|setSoundProperty]] - [[StartSound_(CMS)|startSound]] - [[StopSound_(CMS)|stopSound]] - [[ToggleSoundPause_(CMS)|toggleSoundPause]] |
|} | |} |
Revision as of 01:50, 4 November 2014
Function History |
---|
Available since v4.0 |
Use this to store the sound.id for an audio file into a variable; which you can use to stop/pause/resume or edit the linked sounds properties.
Syntax:
getSoundId("filename")
Example:
-- let's store the sound ID into a variable for later use
local soundID = getSoundId("vispath:sounds/example.ogg")
Arguments
filename: path
The path to the audio file whose ID we want to obtain; vispath: must be included at the beginning of the path.
"vispath:path/filename.type"
Flags
none
Return
id
Returns the sound ID as an integer value.
Relevant Pages: getSoundProperty - setSoundProperty - startSound - stopSound - toggleSoundPause |