Type Function Library audio.* Return value Boolean Revision Release 2024.3703 Keywords audio, volume, max volume, set maximum, sound See also audio.setMinVolume() audio.getVolume() audio.setVolume() audio.getMaxVolume() audio.setMinVolume() audio.getMinVolume()
Clamps the maximum volume to the set value. Any volumes that exceed the value will be played at the maximum volume level.
This function returns true
on success or false
if otherwise.
There is no max volume for the master volume.
audio.setMaxVolume( volume, options )
Number. The new max volume level you want to apply. Valid numbers range from 0.0
to 1.0
, where 1.0
is the maximum value.
Table. Table that supports a single key, channel
, which is the channel number you want to set the max volume on. Valid channels are 1
to the maximum number of channels (currently 32). Specify 0
to apply the max volume to all channels.
audio.setMaxVolume( 0.75, { channel=1 } )