Global Command: setVolume

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

Set the general volume levels for music, sound, speech, videos, and master.

Related functions getVolume


Syntax

setVolume(type, volume)


Parameters

Parameter Type Supported values Description
type integer eMusicVolume (0) The type of volume to return.


The available types are members of the sound volume enumeration. The parameter can be passed as name (e. g. eMusicVolume), or number (e. g. 0), see the examples.

eSoundVolume (1)
eSpeechVolume (2)
eMovieVolume (3)
eGlobalVolume (4)
volume integer The new value for volume in the range of 0 to 100.


Return values

none


Examples

Example 1: Set the speech volume level to 80.

setVolume(eSpeechVolume, 80)

-- You can also pass the volume type as an integer. The following code will do the same.
setVolume(2, 80)