Difference between revisions of "GetSoundId"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
+
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
<b>Command History</b>
+
<span class="bold">Command History</span>
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
<div style="background:#ebebeb" width="100%">Available since <span style="color:orange">v3.8</span></div>
+
<div class="alt-bg">Available since v3.8</div>
 
</div></div>
 
</div></div>
  
Line 23: Line 23:
  
  
<b><u>Arguments</u></b>
+
<span class="bold underline">Arguments</span>
  
<b>filename</b>: path <br/>
+
<span class="bold">filename</span>: path <br/>
 
The path to the audio file whose ID we want to obtain! ("path/filename.type")
 
The path to the audio file whose ID we want to obtain! ("path/filename.type")
  
  
<b><u>Flags</u></b>
+
<span class="bold underline">Flags</span>
  
 
none
 
none
  
  
<b><u>Return</u></b>
+
<span class="bold underline">Return</span>
  
<b>id</b> <br/>
+
<span class="bold">id</span> <br/>
 
Returns the sound ID as an integer value.
 
Returns the sound ID as an integer value.
 
{{i18n|GetSoundId}} <br/>
 
{{i18n|GetSoundId}} <br/>
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
+
{| class="tbl-ds"
 
|-
 
|-
|<b>Relevant Pages</b>: [[GetSoundProperty|getSoundProperty]] - [[SetSoundProperty|setSoundProperty]] - [[StartSound|startSound]] - [[StopSound|stopSound]] - [[ToggleSoundPause|toggleSoundPause]]
+
|<span class="bold">Relevant Pages</span>: [[GetSoundProperty|getSoundProperty]] - [[SetSoundProperty|setSoundProperty]] - [[StartSound|startSound]] - [[StopSound|stopSound]] - [[ToggleSoundPause|toggleSoundPause]]
 
|}
 
|}

Revision as of 16:45, 2 April 2013

Command History

Available since v3.8


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")


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


Arguments

filename: path
The path to the audio file whose ID we want to obtain! ("path/filename.type")


Flags

none


Return

id
Returns the sound ID as an integer value.


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