Adjusting volume between scenes/labels?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Danah
Newbie
Posts: 17
Joined: Fri Sep 27, 2019 7:38 pm
Contact:

Adjusting volume between scenes/labels?

#1 Post by Danah » Wed Oct 16, 2019 6:43 pm

In a few parts of my game it will be raining.
The chapter starts outside the house, and it's raining. I'll play the "rain.ogg" as a sound, or create another music channel (because there's already a song playing too).
Anyway, when they get in the house, the rain sound volume has to be turned down a little.
After, when they go outside again, the rain volume goes back o normal.

It would be like:
*label outsidehouse1= normal volume.
*label house1= lower volume.
*label outsidehouse2= normal volume again.

How do I adjust it on Renpy?
Thanks.

User avatar
Alex
Lemma-Class Veteran
Posts: 2318
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Adjusting volume between scenes/labels?

#2 Post by Alex » Wed Oct 16, 2019 7:00 pm

Try it like

Code: Select all

$ renpy.music.set_volume(0.5, delay=0, channel='my_rain_channel')
https://www.renpy.org/doc/html/audio.ht ... set_volume

User avatar
Danah
Newbie
Posts: 17
Joined: Fri Sep 27, 2019 7:38 pm
Contact:

Re: Adjusting volume between scenes/labels?

#3 Post by Danah » Wed Nov 13, 2019 9:32 pm

Alex wrote:
Wed Oct 16, 2019 7:00 pm
Try it like

Code: Select all

$ renpy.music.set_volume(0.5, delay=0, channel='my_rain_channel')
https://www.renpy.org/doc/html/audio.ht ... set_volume
Thank you :)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 2721
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Adjusting volume between scenes/labels?

#4 Post by Imperf3kt » Wed Nov 13, 2019 10:32 pm

While the method provided by Alex works well, rain does not sound the same from inside a building as it does outside, or even inside different structures.

For extra realism, I'd consider using multiple audio samples.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Todo list:
Actually finish a project

User avatar
Danah
Newbie
Posts: 17
Joined: Fri Sep 27, 2019 7:38 pm
Contact:

Re: Adjusting volume between scenes/labels?

#5 Post by Danah » Wed Nov 27, 2019 5:09 pm

Imperf3kt wrote:
Wed Nov 13, 2019 10:32 pm
While the method provided by Alex works well, rain does not sound the same from inside a building as it does outside, or even inside different structures.

For extra realism, I'd consider using multiple audio samples.
Thank you! You're right. Maybe I should try another audio for a building inside Thanks.

Post Reply

Who is online

Users browsing this forum: Google [Bot], isobellesophia, solarProtag