Global Command: getSoundId

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Redirected from GetSoundId (CMS))

Retrieve the id of a currently active audio file. Use the sound id to stop/pause/resume or edit the linked sound properties.

Related functions getSoundProperty | setSoundProperty | startSound | stopSound | toggleSoundPause


Syntax

getSoundId(soundfile)


Parameters

Parameter Type Description
soundfile string Relative path to the audio file whose id you want to obtain. Add the "vispath:" prefix.


Return values

Type Description
integer Unique id referencing the requested sound, or -1 if the sound is not active.


Examples

Example 1: Store the sound id into a variable for later use.

local mySoundId = getSoundId("vispath:sounds/example.ogg")