SetSoundProperty

From The Official Visionaire Studio: Adventure Game Engine Wiki
Revision as of 14:56, 26 November 2013 by Vis apiuser (talk)

setSoundProperty

Available since: v3.8
Sets properties of the specified sound.

Lua Syntax:

setSoundProperty(soundID, {flags=1, 
    volume = int, 
    balance = int, 
    loop = true|false, 
    offset = int})

Arguments

soundID

int - ID specifying sound where properties will be set.

Flags

vol/volume

Set sound volume (0 ... mute, 100 ... full volume).

bal/balance

Set sound balance (-100 ... left, 0 ... center, +100 right).

lop/loop

If true then loop sound, otherwise play it only once.

ofs/offset

Set the sound to a specific offset (seek) in milliseconds.

Return Values

status
True if properties were set successfully, false if setting properties failed.

Examples

Example 1:

local soundID = getSoundId('vispath:sounds/example.ogg')

setSoundProperty(soundID, {flags=1, volume=80, balance=20}