VOLUME
 
Sets or returns master or channel volume.

Syntax


Volume level
level = Volume()
Volume channel, level
level = Volume(channel)


Description

VOLUME controls how loud sfxlib output is. The one-argument statement changes the master volume, which affects the overall mix. The two-argument statement changes the volume for one channel, which is useful for balancing music, effects, and generated voices separately.

The function forms return the current master or channel volume. That lets a program save a value, fade it over time, or restore it later.

Volume changes affect sounds mixed through sfxlib. They do not change the operating system speaker volume.


Example

volume 0.5
volume 1, 0.25
print "master="; volume()
print "channel 1="; volume(1)


Notes

  • Use PAN or BALANCE for left/right placement instead of loudness.


See also