Set volume globally

set_volume!

[vol (number)]

Set the main system volume to vol. Accepts a value between 0 and 5 inclusive. Vols greater or smaller than the allowed values are trimmed to keep them within range. Default is 1.

Introduced in v2.0.0

Example 0 


set_volume! 2



 
 # Set the main system volume to 2



Example 1 


set_volume! -1



 
 # Out of range, so sets main system volume to 0



Example 2 


set_volume! 7



 
 # Out of range, so sets main system volume to 5