Difference between revisions of "Global Command: stopSound"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "Stop a playing sound. {| class="ts" |- | style="width:15%" | Related functions | getSoundId | Global Command: getSoundProperty|getSoundProper...")
 
(No difference)

Latest revision as of 21:44, 4 May 2023

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)