Prevent engine from muting itself when minimized?
I've noticed that UE4 will mute all of its audio output when it doesn't have window focus. This poster found a way to get around this by altering the engine files, but I'd like to be able to change this functionality in a game or plugin, so the packaged executable will have audio when minimized. Is there any way to do this from a project's code?
The exact line in the engine that is causing this trouble is in FWindowsPlatformMisc::PumpMessages(), which is static and thus cannot be overridden from a custom FWindowsPlatformMisc subclass.
asked Nov 04 '14 at 09:34 PM in C++ Programming
I've just recently added a config value to set the unfocused volume in CL#2341022, so you'll soon be able to add:
To your Project's DefaultEngine.ini file to achieve the same effect without setting the volume multiplier constantly. You'll know when you've got this update because I removed GVolumeMultiplier at the same time.
answered Nov 06 '14 at 10:06 AM
I've found a workaround for this problem. What I do is add a line to an FTickableGameObject, in the Tick() function so it's called constantly. This line is just:
This overrides the engine's natural functionality, which sets GVolumeMultiplier to 0 if the window doesn't have focus. It's not a perfect solution; it may cause problems if other parts of the project try to edit GVolumeMultiplier (maybe like an options menu that adjusts the game volume), but it works for a simple case.
answered Nov 06 '14 at 01:45 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here