Sound volume
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Description
sound_volume(sound_id, volume)
sound_volume is used to change the volume a previously loaded sound.
Return value
This function won't return a value.
Arguments
# | Argument | Type | Description |
---|---|---|---|
1 | sound_id | ID | Sound id received from the sound_add function. |
2 | volume | Number | New volume, ranges from 0.0 (off) to 1.0 (loudest) |
Example
-- Load sounds
mysound1 = sound_add("mysound1.wav")
-- Play the sound
sound_play(mysound1)
-- Set volume to 50%
sound_volume(mysound1, 0.5)