audio sliders not functioning [SOLVED]

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
raynetempura
Newbie
Posts: 14
Joined: Fri Sep 06, 2019 4:17 pm
Contact:

audio sliders not functioning [SOLVED]

#1 Post by raynetempura »

Hello! I have been developing a demo for my game and I recently put the music in, but the tracks are all very quiet. I double-checked the preferences page that the volume mixer was all the way up, and it was. When I play the tracks outside of the game, they sound plenty loud. But within the game, they are very quiet. Just to be sure, as a test, I used audacity to make the main menu track significantly louder, but there was zero change to the volume of the track in the game. I have no idea what could be causing this. I've tried searching through the forums, but I haven't found too many posts relevant to this issue.

I found this bit of code in another topic for someone who was having an issue of the volume being too loud, so I tried it:

Code: Select all

    python:
        _preferences.set_volume('music', 0.5)
I changed the 0.5 to 1.0, though. However, when I launched the game, there was no difference. Yet when I selected "New Game", the music suddenly became quite loud. If I exited back to the title screen, it remained loud. But when I went to preferences and touched the volume slider even a fraction, it reduced the sound dramatically almost instantly. Even after turning the volume all the way back up, the music remained quiet like it was when I initially launched the game.

I'm new to Ren'py, so any advice would be greatly appreciated.
Last edited by raynetempura on Sun Sep 20, 2020 10:10 am, edited 1 time in total.

raynetempura
Newbie
Posts: 14
Joined: Fri Sep 06, 2019 4:17 pm
Contact:

Re: audio too quiet in game, like it's being suppressed

#2 Post by raynetempura »

UPDATE: I have been investigating the issue and I've narrowed it down. I decided to make a test game and the audio worked perfectly. If anything, it was too loud. Adjusting the volume slider worked like a charm. I tested out adding just the screens.rpy to the test game and the moment I touched the volume slider, it reduced it down to a quiet level. Every time I relaunched it after that, it was really quiet. So I went digging through the screens.rpy to find out what the issue was. I'm still not entirely sure what is causing this, but I discovered something new.

I removed the entire "Preferences" section from the screens.rpy as a test. When I launched the game and went into "Preferences", a super basic version of the screen showed up and the volume slider was at about 30%. When I turned it up, the music was perfectly loud again. I added the preferences section back in and relaunch the project. Volume was still super loud. I then went into preferences, touched the slider, and bam. Back to the age old issue of immediately going quiet, and never getting louder again. It seems like something with the slider is reducing the volume to 30% and never raising it higher than that.

I think it might also be affecting the sound effects, too, as I could hear my sound effects just fine in my test game, but not at all in my main game.

This is the code I am using for my sliders:

Code: Select all

    bar: #BGM Volume
        left_bar "gui/Settings/slider_full.png"
        right_bar "gui/Settings/slider_empty.png"
        thumb None
        value Preference("music volume") pos 1170,315

    bar: #SFX Volume
        left_bar "gui/Settings/slider_full.png"
        right_bar "gui/Settings/slider_empty.png"
        thumb None
        value Preference("sound volume") pos 1170,483
Strangely enough, the text speed slider, which looks like the audio sliders, functions completely as expected.

raynetempura
Newbie
Posts: 14
Joined: Fri Sep 06, 2019 4:17 pm
Contact:

Re: audio too quiet in game, like it's being suppressed

#3 Post by raynetempura »

UPDATE: Well, I was talking to the programmer who coded my GUI and, as it turns out, the graphics were smaller than functionality! So he added an xmaximum value to all of the slider bars to limit the side of that "invisible" bar function and it worked like a charm!

So now our sliders look like this:

Code: Select all

    bar: #BGM Volume
        left_bar "gui/Settings/slider_full.png"
        right_bar "gui/Settings/slider_empty.png"
        thumb None
        value Preference("music volume")
        xmaximum 451
        pos 1170,315
I just wanted to share with you his awesome solution just in case anyone else has this issue!

Post Reply

Who is online

Users browsing this forum: Google [Bot]