# How can I keep Audio from losing focus when not in Editor?

**URL:** <https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745>\
**Category:** Audio\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [July 9, 2014, 2:31pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745 "2014-07-09T14:31:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ari2000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ari2000](https://forums.unrealengine.com/u/Ari2000)\
**Post date:** [July 9, 2014, 2:31pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/1 "2014-07-09T14:31:16Z")

</div>

Hello. I have an Ambient looping Audio playing in my game, but it only plays when I click the game window. When I have my mouse click somewhere off screen, it stops playing. I know this is probably an issue with OnFocus. Is there a way in Blueprint to play the Audio continuously, even when the game is NOT in focus?

---

<div class="post-metadata">

**Author:** ![Ari2000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ari2000](https://forums.unrealengine.com/u/Ari2000)\
**Post date:** [July 10, 2014, 6:45pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/2 "2014-07-10T18:45:10Z")

</div>

I know Unity has an Application.OnFocus function that sends an event for the game being onfocus or not. I am looking for a way to do something similar- hopefully just setting music to keep playing EVEN when the game is not in focus.

---

<div class="post-metadata">

**Author:** ![Ari2000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ari2000](https://forums.unrealengine.com/u/Ari2000)\
**Post date:** [July 14, 2014, 6:12pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/3 "2014-07-14T18:12:12Z")

</div>

If anyone is still wondering, I figured it out!

The engine automatically mutes itself whenever the window is not focused.

In WindowsPlatformMisc.cpp:

// if its our window, allow sound, otherwise silence it  
GVolumeMultiplier = HasFocus ? 1.0f : 0.0f;

All I did was comment out that line and viola- it works!

---

<div class="post-metadata">

**Author:** ![keru](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@keru](https://forums.unrealengine.com/u/keru)\
**Post date:** [July 19, 2014, 5:15pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/4 "2014-07-19T17:15:20Z")

</div>

Hi  
So it’s needed a full recompilation of the Engine or it’s enough to override that function somewhere in my project?

---

<div class="post-metadata">

**Author:** ![Ari2000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ari2000](https://forums.unrealengine.com/u/Ari2000)\
**Post date:** [July 19, 2014, 5:21pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/5 "2014-07-19T17:21:29Z")

</div>

Yes, after you comment out that line, you will need to recompile your code in order for it to work. I was never able to find a way in Blueprint to do it.

So, comment out that line of code, recompile, then you should be good to go.

---

<div class="post-metadata">

**Author:** ![Kory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kory](https://forums.unrealengine.com/u/Kory)\
**Post date:** [August 16, 2015, 4:37am UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/6 "2015-08-16T04:37:37Z")

</div>

This has been moved to the Engine.ini file as of 4.6:

```
GConfig->GetFloat(TEXT("Audio"), TEXT("UnfocusedVolumeMultiplier"), UnfocusedVolumeMultiplier, GEngineIni);

```

In the DefaultEngine.ini or any of the Engine config files where you would need to change this just set:

```
[Audio]
UnfocusedVolumeMultiplier=1.0
```

---

<div class="post-metadata">

**Author:** ![TorQueMoD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/torquemod/32/710746_2.png) [@TorQueMoD](https://forums.unrealengine.com/u/TorQueMoD)\
**Post date:** [May 16, 2016, 2:56am UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/7 "2016-05-16T02:56:24Z")

</div>

Just out of curiosity, why would you want to do this? Personally I find it irritating when I minimize a game and its audio keeps playing.

---

<div class="post-metadata">

**Author:** ![Luanrs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luanrs](https://forums.unrealengine.com/u/Luanrs)\
**Post date:** [June 17, 2016, 4:00am UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/8 "2016-06-17T04:00:44Z")

</div>

If the Engine is open you’ll need to restart ir for the changes take effect.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5c36c7b6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5c36c7b6](https://forums.unrealengine.com/u/anonymous_user_5c36c7b6)\
**Post date:** [March 6, 2017, 9:59pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/9 "2017-03-06T21:59:31Z")

</div>

Hi, do you know if this works for mobile devices too? (iOS & Android)

---

<div class="post-metadata">

**Author:** ![Kory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kory](https://forums.unrealengine.com/u/Kory)\
**Post date:** [March 6, 2017, 11:10pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/10 "2017-03-06T23:10:51Z")

</div>

No, I don’t know, please post your findings for others. Thanks!

---

<div class="post-metadata">

**Author:** ![RaHol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RaHol](https://forums.unrealengine.com/u/RaHol)\
**Post date:** [November 13, 2020, 4:07am UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/11 "2020-11-13T04:07:06Z")

</div>

preferably you want to enable/disable this feature in game menu.

why would you want to do this? imagine you have 2 monitors, playing game where sound is important, and then you need to alt+tab to the second monitor (you still can see whats happening on the other monitor, if you play windowed fullscreen mode, but you will not hear sounds you want to hear even alt-tabbed for a while to a chat or something you have on the other screen)

---

<div class="post-metadata">

**Author:** ![Ale3D](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ale3D](https://forums.unrealengine.com/u/Ale3D)\
**Post date:** [March 19, 2021, 6:51pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/12 "2021-03-19T18:51:11Z")

</div>

![333018-audio.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/e/f2e2f4f181ba7d8e0de9e9784566ab4f4ed82444.png)

Just press this box

---

<div class="post-metadata">

**Author:** ![Reaper2k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Reaper2k](https://forums.unrealengine.com/u/Reaper2k)\
**Post date:** [April 13, 2021, 6:05am UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/13 "2021-04-13T06:05:06Z")

</div>

This is an editor setting, not a setting for the shipped build.

---

<div class="post-metadata">

**Author:** ![ENDVR11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ENDVR11](https://forums.unrealengine.com/u/ENDVR11)\
**Post date:** [August 3, 2022, 7:20am UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/14 "2022-08-03T07:20:36Z")

</div>

You are a legend! Thank you!

---

<div class="post-metadata">

**Author:** ![Joneshong](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joneshong](https://forums.unrealengine.com/u/Joneshong)\
**Post date:** [October 1, 2022, 3:01pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/15 "2022-10-01T15:01:43Z")

</div>

Thanks!  
I’m working on UE4.27.  
The file `DefaultEngine.ini` is under` <PROJECT_NAME>/Config/DefaultEngine.ini`.  
Add that setting in the bottom and it works!

---

<div class="post-metadata">

**Author:** ![KibblesBits](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KibblesBits](https://forums.unrealengine.com/u/KibblesBits)\
**Post date:** [January 14, 2023, 9:03pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/16 "2023-01-14T21:03:55Z")

</div>

Now the real question is how do we turn this into a toggle switch in the game settings menu in the shipped product so people can turn it on and off like I see in hundreds of other games.

---

<div class="post-metadata">

**Author:** ![Denny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Denny](https://forums.unrealengine.com/u/Denny)\
**Post date:** [February 2, 2023, 2:15pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/17 "2023-02-02T14:15:51Z")

</div>

FApp::GetUnfocusedVolumeMultiplier() and FApp::SetUnfocusedVolumeMultiplier(float InVolumeMultiplier). It updates GEngineIni. You can use your own UPROPERTY(config) to drive it too I suppose.

---

<div class="post-metadata">

**Author:** ![Engelard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engelard/32/903560_2.png) [@Engelard](https://forums.unrealengine.com/u/Engelard)\
**Post date:** [March 1, 2025, 4:12pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/18 "2025-03-01T16:12:43Z")

</div>

Also there is a fast easy way to do this exists: [https://www.fab.com/listings/b5509ac0-99dd-470f-bc6d-3554a54c313b](https://www.fab.com/listings/b5509ac0-99dd-470f-bc6d-3554a54c313b)

---

<div class="post-metadata">

**Author:** ![aiorosu\_cn](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aiorosu_cn/32/88712_2.png) [@aiorosu\_cn](https://forums.unrealengine.com/u/aiorosu_cn)\
**Post date:** [August 5, 2025, 9:37am UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/19 "2025-08-05T09:37:43Z")

</div>

If you want build pak auto set this ，you can modify Engine/config/BaseEngine.ini file,set UnfocusedVolumeMultiplier=1.0

---

<div class="post-metadata">

**Author:** ![James\_Alliban](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@James\_Alliban](https://forums.unrealengine.com/u/James_Alliban)\
**Post date:** [May 18, 2026, 7:05pm UTC](https://forums.unrealengine.com/t/how-can-i-keep-audio-from-losing-focus-when-not-in-editor/287745/20 "2026-05-18T19:05:09Z")

</div>

This worked for me - Add:

[Audio]  
UnfocusedVolumeMultiplier=1.0

To DefaultEngine.ini.

Restart the engine.
