[SOLVED] Lower the volume of a sound effect?

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
Kinmoku
Miko-Class Veteran
Posts: 560
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: Love IRL, Memories
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

[SOLVED] Lower the volume of a sound effect?

#1 Post by Kinmoku » Tue Dec 17, 2019 12:12 pm

Hi all,

I'm sure this is easy but I don't know how to do it: How do I lower the volume of a SFX without altering the sound file itself?

Ideally, I'd like the SFX to stay loud (as I plan to use it again later in the game), but for this one scene, it appears in the background (along with ambient sound) and I want it to be a little quieter. Right now, it's too distracting. Having two sound files seem unnecessary to me.

If I lower the SFX channel itself, then the ambient sound will also lower, which I don't want.

Any help on how to lower the one sound?
Last edited by Kinmoku on Mon Mar 09, 2020 5:43 am, edited 1 time in total.

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Lower the volume of a sound effect?

#2 Post by IrinaLazareva » Tue Dec 17, 2019 3:33 pm

You can create a separate channel

Code: Select all

init python:
    renpy.music.register_channel('mychanel')
and then adjust the sound using the function:

Code: Select all

    $ renpy.music.set_volume(.5, channel='mychanel')
https://renpy.org/doc/html/audio.html#r ... er_channel
https://renpy.org/doc/html/audio.html#r ... set_volume

P.S. Moreover, you can create your own mixer, but you will have to rewrite the preferences screen:
mixer
The name of the mixer the channel uses. By default, Ren'Py knows about the "music", "sfx", and "voice" mixers. Using other names is possible, but may require changing the preferences screens.

User avatar
Kinmoku
Miko-Class Veteran
Posts: 560
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: Love IRL, Memories
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Lower the volume of a sound effect?

#3 Post by Kinmoku » Thu Dec 19, 2019 5:33 am

Ah thank you! :)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]