Global Command: stopSound

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 20:44, 4 May 2023 by EK (talk | contribs) (Created page with "Stop a playing sound. {| class="ts" |- | style="width:15%" | Related functions | getSoundId | Global Command: getSoundProperty|getSoundProper...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Stop a playing sound.

Related functions getSoundId | getSoundProperty | setSoundProperty | startSound | toggleSoundPause


Syntax

stopSound(soundId)


Parameters

Parameter Type Description
soundId integer Id of the sound to stop.


Return values

Type Description
boolean True if sound was stopped successfully, false otherwise.


Examples

Example 1: Stop a playing sound.

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

stopSound(mySoundId)