Mute Audio On Focus Loss

Background music still plays through if “Mute Audio On Focus Loss” is enabled. That includes (but probably not limited to) the FiveM main menu background music, server loading screen intro music, custom server radios, and audio streams in general.

When “Mute Audio On Focus Loss” is enabled in the game settings, all audio should be muted when the game is in background or minimized. Currently that doesn’t apply to FiveM audio streams in general. In fact, the server loading screen intro music still plays through even if “Music Volume” is set to 0 in the game settings, or at least that happens in every server i play. However, there’s no way for me to know if this happens in every server, so i can’t be certain of whether this particular problem is related to the FiveM engine itself or not.

In any case, “Mute Audio On Focus Loss” seems to have no effect when it comes to any audio that plays through the FiveM engine.

The server loading screen audio has nothing to do with the game audio settings, some servers allow you to pause the music with spacebar or allow you to turn it up and down with arrow keys.

For the muting of audio on focus lost, are you saying that all audio still plays or just custom audio from the server,? If it is the latter then it’s intended.

Not really a ‘bug’ as much as a feature request - one which might be hard to fulfill, even, since most the things you named are played through CEF which I don’t think offers any global volume mixer support at all.

As i said, all audio is played, including FiveM main menu background music, which has nothing to do with servers. In fact, the main menu background music (which plays through FiveM GTA process itself, not the chromium browser sub process) does not play if you have “Music Volume” set to zero, so it should not play on focus loss either. The same rule should apply to audio streams that do play via chromium process, though.

I’m not sure what you mean by “global” but you definitely can control the volume of FiveM audio streams globally. They play through “FiveM Chromium subprocess”, which has it’s own volume control on windows mixer.

Anyway, i am aware streams audio streams can be tied to the “music volume” setting via server script. Not sure servers can tell whether “mute of focus loss” is enable or not, though. I’m reporting because i believe this should be a client game setting, not dependent on servers to fix it.

The main menu music is likely a separate issue, also I don’t think changing the user preferences is a good idea or even has an API exposed (and there’s no other way perhaps to change volume for a full process) which is why I mentioned the Chrome stuff as a special case concern.

Ah.

It seems the CEF version we use does have a call for simply muting/unmuting the browser instance globally.

Now, I still wonder why the game’s setting is not being honored by the main menu music which is in fact passed through the game audio subsystem. :thinking:

1 Like

I also don’t think it should change any user settings regarding system volume mixer or anything like that. But considering the chromium browser is a FiveM sub process, i thought it would be as simple as just signaling it to stop playing audio when the game is out of focus. We don’t really need volume controls for this, nor does it need to be hard muted through the system. But i don’t have the technical knowledge to realize how that could be done otherwise, if it’s even possible, so it’s something for you devs to figure out. What i know is that it’s possible to control the volume of those audio streams through the game’s own “Music Volume” setting.

Also, i don’t think all audio streams should be forcefully tied to the “music volume” setting, given that not all audio streams are necessarily music related. So that’s why the volume settings are probably better to stay server defined.

Edit:

That’s great, so it actually could be done. Good to know!

Implemented.

1 Like