documentation index ◦ reference manual ◦ function index
| Function: | renpy.music.set_volume | (volume, delay=0, channel="music"): |
This sets the volume of the named channel. The volume is a number between 0.0 and 1.0, and is interpreted as a fraction of the mixer volume for the channel.
It takes delay seconds to change the volume. This value is persisted into saves, and participates in rollback.
# Start some music playing in the background
play music "mozart.ogg"
"Some music is playing at normal volume."
# Lower the music volume by half
$ renpy.music.set_volume(0.5, .5, channel="music")
"Let's lower the music volume by half"
# Set back the music volume to its original volume number
$ renpy.music.set_volume(1.0, .5, channel=7)
"Let's set back the music volume to its original volume number"