# Prevent engine from muting itself when minimized?

**URL:** <https://forums.unrealengine.com/t/prevent-engine-from-muting-itself-when-minimized/298168>\
**Category:** Audio\
**Tags:** volume, focus, engine, unreal-engine, question\
**Created:** [November 4, 2014, 9:34pm UTC](https://forums.unrealengine.com/t/prevent-engine-from-muting-itself-when-minimized/298168 "2014-11-04T21:34:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cognimancer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cognimancer](https://forums.unrealengine.com/u/cognimancer)\
**Post date:** [November 4, 2014, 9:34pm UTC](https://forums.unrealengine.com/t/prevent-engine-from-muting-itself-when-minimized/298168/1 "2014-11-04T21:34:32Z")

</div>

I’ve noticed that UE4 will mute all of its audio output when it doesn’t have window focus. [This poster](https://answers.unrealengine.com/questions/66918/keep-audio-from-losing-focus.html) 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.

---

<div class="post-metadata">

**Author:** ![cognimancer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cognimancer](https://forums.unrealengine.com/u/cognimancer)\
**Post date:** [November 6, 2014, 1:45am UTC](https://forums.unrealengine.com/t/prevent-engine-from-muting-itself-when-minimized/298168/2 "2014-11-06T01:45:04Z")

</div>

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:

```
GVolumeMultiplier = 1.0f;

```

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.

---

<div class="post-metadata">

**Author:** ![IdentityCrisisUK](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IdentityCrisisUK](https://forums.unrealengine.com/u/IdentityCrisisUK)\
**Post date:** [November 6, 2014, 10:06am UTC](https://forums.unrealengine.com/t/prevent-engine-from-muting-itself-when-minimized/298168/3 "2014-11-06T10:06:04Z")

</div>

I’ve just recently added a config value to set the unfocused volume in CL#2341022, so you’ll soon be able to add:

```
[Audio]
UnfocusedVolumeMultiplier=1.0

```

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.

---

<div class="post-metadata">

**Author:** ![cognimancer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cognimancer](https://forums.unrealengine.com/u/cognimancer)\
**Post date:** [November 6, 2014, 6:25pm UTC](https://forums.unrealengine.com/t/prevent-engine-from-muting-itself-when-minimized/298168/4 "2014-11-06T18:25:04Z")

</div>

Great! That sounds very helpful.

---

<div class="post-metadata">

**Author:** ![REDVIL44](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@REDVIL44](https://forums.unrealengine.com/u/REDVIL44)\
**Post date:** [November 16, 2018, 6:54am UTC](https://forums.unrealengine.com/t/prevent-engine-from-muting-itself-when-minimized/298168/5 "2018-11-16T06:54:14Z")

</div>

Thanks, adding this to DefaultEngine.ini worked for me:  
[Audio]  
UnfocusedVolumeMultiplier=1.0
