Difference between revisions of "StopSound"

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 29: Line 29:
  
  
<b><u>Arguments</u></b>
+
<span class="bold underline">Arguments</span>
  
<b>id</b>: integer (number) <br/>
+
<span class="bold">id</span>: integer (number) <br/>
 
The id for the currently playing audio file! ("sound.id")
 
The id for the currently playing audio file! ("sound.id")
  
  
<b><u>Flags</u></b>
+
<span class="bold underline">Flags</span>
  
 
none
 
none
  
  
<b><u>Return</u></b>
+
<span class="bold underline">Return</span>
  
 
none
 
none
{{i18n|StartSound}} <br/>
+
{{i18n|StopSound}} <br/>
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
+
{| class="tbl-ds"
 
|-
 
|-
|<b>Relevant Pages</b>: [[GetSoundId|getSoundId]] - [[GetSoundProperty|getSoundProperty]] - [[SetSoundProperty|setSoundProperty]] - [[StartSound|startSound]] - [[ToggleSoundPause|toggleSoundPause]]
+
|<span class="bold">Relevant Pages</span>: [[GetSoundId|getSoundId]] - [[GetSoundProperty|getSoundProperty]] - [[SetSoundProperty|setSoundProperty]] - [[StartSound|startSound]] - [[ToggleSoundPause|toggleSoundPause]]
 
|}
 
|}

Revision as of 14:11, 5 April 2013

Command History

Available since v3.8


Allows you to stop any playing sound files!


Syntax:

stopSound(id)


Example 1: basic stop audio file method! (!messy)

stopSound(getSoundId("sounds/example.ogg"))

Example 2: again using sound.id via a variable!

-- let's store the sound.id for example.ogg inside of a variable!
local soundID = getSoundId("sounds/example.ogg")
stopSound(soundID)


Arguments

id: integer (number)
The id for the currently playing audio file! ("sound.id")


Flags

none


Return

none


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