Difference between revisions of "Global Command: toggleSoundPause"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Toggle an active sound between playing and paused states. {| class="ts" |- | style="width:15%" | Related functions | getSoundId | Global Comm...")
 
(No difference)

Latest revision as of 21:50, 4 May 2023

Toggle an active sound between playing and paused states.

Related functions getSoundId | getSoundProperty | setSoundProperty | startSound | stopSound


Syntax

toggleSoundPause(soundId)


Parameters

Parameter Type Description
soundId integer Id of the sound which should be paused/resumed.


Return values

Type Description
boolean True if sound was successfully paused/resumed, false otherwise.


Examples

Example 1: Toggle the pause state of an active sound.

-- Sound id can only be retrieved if the sound is active
local mySoundId = getSoundId('vispath:sounds/example.ogg')

toggleSoundPause(mySoundId)