Difference between revisions of "ToggleSoundPause"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
+
==toggleSoundPause==
<span>Command History</span>
 
<div class="mw-collapsible-content">
 
<div class="alt-bg">Available since v3.8</div>
 
</div></div>
 
  
 +
<div class="command-min-version-info">Available since: <span class="command-min-version">v3.8</span></div>
  
Allows you to toggle between pause & resume of an active linked sound!
+
<div class="command-doc">Pause/resume the specified sound.</div>
  
 
+
Lua Syntax:
Syntax:
+
<pre class="command-syntax">toggleSoundPause(soundID)</pre>
 +
===Arguments===
 +
====soundID====
 +
:'''int''' - ID of sound which should be paused/resumed.
 +
===Flags===
 +
===Return Values===
 +
;status
 +
:True if sound was successfully paused/resumed, false otherwise.
 +
===Examples===
 +
Example 1:  
 
<syntaxhighlight>
 
<syntaxhighlight>
toggleSoundPause(id)
+
local soundID = getSoundId('vispath:sounds/example.ogg')
</syntaxhighlight>
 
 
 
 
 
Example 1: basic toggle pause/resume audio file method! (!messy)
 
<syntaxhighlight>
 
toggleSoundPause(getSoundId("sounds/example.ogg"))
 
</syntaxhighlight>
 
 
 
Example 2: again using sound.id via a variable!
 
<syntaxhighlight>
 
-- let's store the sound.id for example.ogg inside of a variable!
 
local soundID = getSoundId("sounds/example.ogg")
 
 
toggleSoundPause(soundID)
 
toggleSoundPause(soundID)
 
</syntaxhighlight>
 
</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>
 
 
none
 
 
 
<span class="bold underline>Return</span>
 
 
<span class="bold">success</span> <br/>
 
Returns true or false boolean value depending on if the linked sound was successfully paused or resumed!
 
{{i18n|ToggleSoundPause}} <br/>
 
{| class="tbl-ds"
 
|-
 
|<span class="bold">Relevant Pages</span>: [[GetSoundId|getSoundId]] - [[GetSoundProperty|getSoundProperty]] - [[SetSoundProperty|setSoundProperty]] - [[StartSound|startSound]] - [[StopSound|stopSound]]
 
|}
 

Revision as of 17:12, 22 November 2013

toggleSoundPause

Available since: v3.8
Pause/resume the specified sound.

Lua Syntax:

toggleSoundPause(soundID)

Arguments

soundID

int - ID of sound which should be paused/resumed.

Flags

Return Values

status
True if sound was successfully paused/resumed, false otherwise.

Examples

Example 1:

local soundID = getSoundId('vispath:sounds/example.ogg')
toggleSoundPause(soundID)