Emphasize Audio Glitch, Need Elegant Workaround

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
SypherZent
Veteran
Posts: 368
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Location: Puerto Rico
Contact:

Emphasize Audio Glitch, Need Elegant Workaround

#1 Post by SypherZent »

I'm working on a game for someone, but they are using an older version of the engine to avoid having to do a lot of recoding to bring it up to speed (looking at tens of thousands of lines of back end code, so it would take weeks to check everything in the latest version).

Anyway, in this older version of the engine, Emphasize Audio is glitched. If a voice file is playing, the music lowers, but if you open a menu or spam menus, the voice file stops playing and the music stays lowered. The engine has a bug where it doesn't detect that the voice file was interrupted by a menu and therefore, the engine doesn't de-emphasize the audio once the menu has been closed and the gameplay has resumed.

Naturally, this issue is very distracting for the testers. It's highly noticeable and we need to find an elegant solution.

Is there a simple way to just have a menu check if audio is emphasized when closing, and de-emphasize it? We already know 100% of the time, that the voice file won't be playing because opening the menu causes the engine to stop the voice file. So, we simply need a way for the engine to double check that audio isn't emphasized once that menu is closed.

I'm hoping maybe someone who works on the back end of Ren'Py may know more about this and have an elegant solution, even if it requires creating a new function to handle an internal variable/toggle.

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1031
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Emphasize Audio Glitch, Need Elegant Workaround

#2 Post by m_from_space »

I had to read up what you are even talking about, but I understand now, I hope...

So I would think that simply making sure that the audio channel that was "lowered" (in your case "music"), is always set to 100% when a menu is shown.

Like this for alle the game menus (and you have to do it for the main_menu as well):

Code: Select all

screen game_menu(...):
    on "show" action Function(renpy.music.set_volume, volume=1.0, channel="music")

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1031
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Emphasize Audio Glitch, Need Elegant Workaround

#3 Post by m_from_space »

SypherZent wrote: Mon Dec 11, 2023 2:46 pmIs there a simple way to just have a menu check if audio is emphasized when closing, and de-emphasize it?
I had to read up what you are even talking about, but I understand now, I hope...

So I would think that simply making sure that the audio channel that was "lowered" (in your case "music"), is always set to 100% when a menu is shown (or hidden).

Like this for all the game menus (and you have to do it for the main_menu as well):

Code: Select all

screen game_menu(...):
    on "show" action Function(renpy.music.set_volume, volume=1.0, channel="music")
    # on "hide" may also be an option...

Post Reply

Who is online

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