RenPy Volume Level Struggles

Mikethe3DGuy

Member
Game Developer
Mar 14, 2019
232
443
Running into problems adjusting volume levels on individual music play commands. Sometimes I want the music to be bold, and other times to just be audible in the background. The volume clause doesn't seem to do much, if anything, to alter the volume. Am I missing something?

Here's a typical command, but it doesn't seem to matter whether my volume parameter is 0.1 or 1.0 - it's all the same. I have noticed that setting it to 0.0 lowers it noticeably, but it's still quite audible.

play musicloop2 "audio/TAG-A-77_Mood_Aves.ogg" volume 0.3 fadein 2.0
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,130
14,809
Here's a typical command, but it doesn't seem to matter whether my volume parameter is 0.1 or 1.0 - it's all the same. I have noticed that setting it to 0.0 lowers it noticeably, but it's still quite audible.

play musicloop2 "audio/TAG-A-77_Mood_Aves.ogg" volume 0.3 fadein 2.0
Hmm... I tried with both the version 7.5.3 and 8.0.3, and it works as expected. 1.0 turn the volume at its max, 0.0 mute it, and in between values set the volume in between. This whatever if I use one of the default channel or create one for the occasion, and even when I also create a mixer for the new channel.
 

Mikethe3DGuy

Member
Game Developer
Mar 14, 2019
232
443
Hmm... I tried with both the version 7.5.3 and 8.0.3, and it works as expected. 1.0 turn the volume at its max, 0.0 mute it, and in between values set the volume in between. This whatever if I use one of the default channel or create one for the occasion, and even when I also create a mixer for the new channel.
Thanks - well at least it's good to know that something on my end must be mis-configured! The initial programming was done by someone else who later vanished, and I'm now muddling through as a first-timer. Fortunately this seems to be the only unresolved issue I have. He defined the channel like this:

init python:
renpy.music.register_channel("musicloop2", "music", loop=True, stop_on_mute=True)
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,130
14,809
init python:
renpy.music.register_channel("musicloop2", "music", loop=True, stop_on_mute=True)
There's nothing wrong here, and once again I tested it with both the 7.5.3 and 8.0.3 versions, and it works as expected.
That you don't feel the difference when you change the volume can more or less be understood because the defined volume is relative. It's the volume as expressed by Ren'Py, but it have next to pass through the OS mixer, that will possibly change the volume by application, then globally. And finally it will pass through the speakers, that can themselves change the volume a last time. So, it's not impossible, especially at low level, that the difference end being too small to be really felt.

But the problem is that you still ear something when it's at 0. This shouldn't be possible and I found nothing in Ren'Py code that can really explain it.
At first I thought that it could be due to the fadein option, that would continue to play the previous music for 2 seconds, but it's not what happen during my tests. Even when the previous music is defined with the fadeout option, the volume is set correct, and I hear nothing, even when using headphone set at max volume.
 

Mikethe3DGuy

Member
Game Developer
Mar 14, 2019
232
443
Finally realized that it's not the volume clause itself that's not working, but that for some reason when I reload the script from developer mode after changing/saving script.rpy, it doesn't update for any changes at all. I have to quit, then launch the project again.

Again I have no idea why, but it may have to do with how I imported the project? Would love to know how to fix this.