Difference between revisions of "GetSoundId (CMS)"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Redirected page to Global Command: getSoundId)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{| class="toccolours mw-collapsible mw-collapsed ts"
+
#REDIRECT [[Global_Command:_getSoundId]]
|-
 
! 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:
 
<syntaxhighlight>
 
getSoundId("filename")
 
</syntaxhighlight>
 
 
 
 
 
Example:
 
<syntaxhighlight>
 
-- let's store the sound ID into a variable for later use
 
local soundID = getSoundId("vispath:sounds/example.ogg")
 
</syntaxhighlight>
 
 
 
 
 
 
 
<span class="bold underline">Arguments</span>
 
 
 
<span class="bold">filename</span>: path <br/>
 
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>
 
 
 
 
 
<span class="bold underline">Flags</span>
 
 
 
none
 
 
 
 
 
<span class="bold underline">Return</span>
 
 
 
<span class="bold">id</span> <br/>
 
Returns the sound ID as an integer value.
 
<br/>
 
{| class="ts"
 
|-
 
| '''Relevant Pages''': [[GetSoundProperty_(CMS)|getSoundProperty]] - [[SetSoundProperty_(CMS)|setSoundProperty]] - [[StartSound_(CMS)|startSound]] - [[StopSound_(CMS)|stopSound]] - [[ToggleSoundPause_(CMS)|toggleSoundPause]]
 
|}
 
{{toc}}
 

Latest revision as of 20:54, 4 May 2023