Changing the default music/sound (Volume).
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.
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.
- ShippoK
- Veteran
- Posts: 348
- Joined: Wed Mar 28, 2012 8:59 pm
- Projects: Eyes of Gold (In-Progress)
- Organization: (Red Moon)
- Location: Glorious Nippon (A.K.A the USA)
- Contact:
Changing the default music/sound (Volume).
*Edit*
I just wanted to know if there was a code on changing the default music/sound (Volume) when you first start up the game. Like you do for the text speed and such.
I was looking at this page to find such a thing, but I couldn't
http://www.renpy.org/wiki/renpy/doc/ref ... _Variables
I feel as it's something simple to and I just cant get my head wrapped around it either.
I just wanted to know if there was a code on changing the default music/sound (Volume) when you first start up the game. Like you do for the text speed and such.
I was looking at this page to find such a thing, but I couldn't
http://www.renpy.org/wiki/renpy/doc/ref ... _Variables
I feel as it's something simple to and I just cant get my head wrapped around it either.
Last edited by ShippoK on Sat May 12, 2012 5:08 pm, edited 1 time in total.
- SundownKid
- Lemma-Class Veteran
- Posts: 2299
- Joined: Mon Feb 06, 2012 9:50 pm
- Completed: Icebound, Selenon Rising Ep. 1-2
- Projects: Selenon Rising Ep. 3-4
- Organization: Fastermind Games
- Deviantart: sundownkid
- Location: NYC
- Contact:
Re: Changing the default music/sound.
It's in the "Options" script, look for the menu music setting.
Code: Select all
config.main_menu_music = "music/menu.ogg"
- ShippoK
- Veteran
- Posts: 348
- Joined: Wed Mar 28, 2012 8:59 pm
- Projects: Eyes of Gold (In-Progress)
- Organization: (Red Moon)
- Location: Glorious Nippon (A.K.A the USA)
- Contact:
Re: Changing the default music/sound.
I guess I should of rephrase this better.SundownKid wrote:It's in the "Options" script, look for the menu music setting.
Code: Select all
config.main_menu_music = "music/menu.ogg"
I want to change the 'volume' of the music/sound when starting up the game. By default its at full (I think '10'). I want to lower it.
Like for text speed, I change '0' to '30' for the right speed.
-
- Newbie
- Posts: 5
- Joined: Wed Jun 20, 2012 5:25 pm
- Projects: Project DIMINISH
- Organization: Gameosaurus.com
- Location: USA
- Contact:
Re: Changing the default music/sound (Volume).
Looks like this question has gone unanswered.
I was about to make a thread like this, but I'll just +1 the OP here.
Rather than pre-edit all music in the game to have lowered volume, is there a way that the default state of the music volume be something other than 100%?
Or, better yet, is there any sort of "auto-duck" in python that would allow the music volume to be reduced when a voice track is played?
(working on music / VA balance here ...)
I was about to make a thread like this, but I'll just +1 the OP here.
Rather than pre-edit all music in the game to have lowered volume, is there a way that the default state of the music volume be something other than 100%?
Or, better yet, is there any sort of "auto-duck" in python that would allow the music volume to be reduced when a voice track is played?
(working on music / VA balance here ...)
Re: Changing the default music/sound (Volume).
Can't you just call renpy.music.set_volume at the start?
http://www.renpy.org/wiki/renpy/doc/ref ... _Functions
Or would you use _preferences.set_volume?
http://www.renpy.org/wiki/renpy/doc/ref ... references
Hm. I guess I haven't really tried to use music much.
After some digging, found this thread: http://lemmasoft.renai.us/forums/viewto ... f=8&t=2195
OKay, do this: in your splashscreen code, add the following:
That will start the music volume out at 75% instead of 100%. (If you don't have a splashscreen, just add this code).
If you want to dip the music volume before a voice plays, you want to use renpy.music.set_volume before and after the voice to play the music softer and then louder again. You could probably code in a function in python that would do this automatically... I guess it would be something like
That'll dip the music volume and play the voice voiceclip when you use
$ speaking(voiceclip)
But I'm not sure how to build in a way to set the music back to
renpy.music.set_volume(1.0, 0, channel="music")
automatically when the voice clip finished... I thought you could use something like
while not renpy.music.get_playing(channel="voice") == None
but that just seems to crash the game... Hm.
http://www.renpy.org/wiki/renpy/doc/ref ... _Functions
Or would you use _preferences.set_volume?
http://www.renpy.org/wiki/renpy/doc/ref ... references
Hm. I guess I haven't really tried to use music much.
After some digging, found this thread: http://lemmasoft.renai.us/forums/viewto ... f=8&t=2195
OKay, do this: in your splashscreen code, add the following:
Code: Select all
label splashscreen:
python:
if not persistent.set_volumes:
persistent.set_volumes = True
_preferences.volumes['music'] *= .75
If you want to dip the music volume before a voice plays, you want to use renpy.music.set_volume before and after the voice to play the music softer and then louder again. You could probably code in a function in python that would do this automatically... I guess it would be something like
Code: Select all
init:
python:
def speaking(voiceclip):
renpy.music.set_volume(0.2, 0, channel="music")
voice(voiceclip)
$ speaking(voiceclip)
But I'm not sure how to build in a way to set the music back to
renpy.music.set_volume(1.0, 0, channel="music")
automatically when the voice clip finished... I thought you could use something like
while not renpy.music.get_playing(channel="voice") == None
but that just seems to crash the game... Hm.
-
- Newbie
- Posts: 5
- Joined: Wed Jun 20, 2012 5:25 pm
- Projects: Project DIMINISH
- Organization: Gameosaurus.com
- Location: USA
- Contact:
Re: Changing the default music/sound (Volume).
Showsni,
This is all extremely helpful.
I ran all this code and it all works, except the one you had a crash with. I also got the same crash on that last bit when trying to set a rule to reset the audio to max volume after the end of a voice clip.
If I can't define a rule, at least for some of my smaller / demo projects, I can just put the music volume changes around each voice clip and that will do. It'll make the script page bulky, but I can live with that.
Thank you!!!
This is all extremely helpful.
I ran all this code and it all works, except the one you had a crash with. I also got the same crash on that last bit when trying to set a rule to reset the audio to max volume after the end of a voice clip.
If I can't define a rule, at least for some of my smaller / demo projects, I can just put the music volume changes around each voice clip and that will do. It'll make the script page bulky, but I can live with that.
Thank you!!!
- ShippoK
- Veteran
- Posts: 348
- Joined: Wed Mar 28, 2012 8:59 pm
- Projects: Eyes of Gold (In-Progress)
- Organization: (Red Moon)
- Location: Glorious Nippon (A.K.A the USA)
- Contact:
Re: Changing the default music/sound (Volume).
Oh, I didn't expect an answer after so long!
Thanks Snowshi, this is exactly what I wanted.
Thanks Snowshi, this is exactly what I wanted.
Who is online
Users browsing this forum: Bing [Bot], Eliont