Global Command: toggleSoundPause

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 21:50, 4 May 2023 by EK (talk | contribs) (Created page with "Toggle an active sound between playing and paused states. {| class="ts" |- | style="width:15%" | Related functions | getSoundId | Global Comm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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)