# I need help to fix an audio problem (UserWidget)

**URL:** <https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544>\
**Category:** Getting Started & Setup\
**Tags:** audio-bugs, Networking, Replication, damage, unreal-engine, Widget, Blueprint, question\
**Created:** [March 19, 2024, 9:11pm UTC](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544 "2024-03-19T21:11:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [March 19, 2024, 9:11pm UTC](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/1 "2024-03-19T21:11:07Z")

</div>

I have a problem in my project.  
I have reproduced the problem in a new blank project.

These are the project files:  
[UISoundProblem.zip](https://forums.unrealengine.com/uploads/short-url/5Kye6uJ1H9KsbAEGVTYvlEGGG66.zip) (13.2 MB)

The problem is a sound can not be played in a UI (more or less)  
It does works when the player is shooting itself (see this video).

When shooting to other player. The event work, the amimation work, but the sound does not work.

I don’t want to replicate the audio. I just want the player to be the only one that can hear it when he get any damage.

How to fix it?

* * *

In this path are the files:

 ![PATH](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/5/5659d6846044b398bbfebdf86e2a5abc2d53e2ec.png)

I made these changes to the code:

In BP\_FirstPersonCharacter i added this (A Take Damage Rep\_Notify):

 ![BP_FPC1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/b/59b78734c810847e28e090c2b8b711a588b78ab0.png)

 ![BP_FPC2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/d/b/9db47592356184a27bca0153b91a91e324f85a95.png)

In BP\_FirstPersonProjectile i added this (Apply Damage):

 ![BP_FPP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/c/fdc965ef22f5e08fc43bf26f9c936dc4429af2b1.png)

In BP\_Weapon\_Component i added this (Spawn Projectile On Server):

 ![BP_WC](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/d/12d6656e32a054bc03a1a5daa0d602d35e95cd19.png)

I created a new HUD class (MyHUD) with this code:

 ![MyHUD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/f/deff8bcfdcb6fd30a05f755cfa2f3afb7ce3cf22.png)

I created a new UserWidget class (UI\_PlaySoundWhenTakeDamage) with this code:

 ![UI_PSWTD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/c/1ec7fd02bc40ac3080b4969397c5f70bb3082e45.png)

* * *

Any help is welcome!!

Thank you so much!!

---

<div class="post-metadata">

**Author:** ![Featuriing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/featuriing/32/1135409_2.png) [@Featuriing](https://forums.unrealengine.com/u/Featuriing)\
**Post date:** [March 20, 2024, 7:33pm UTC](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/2 "2024-03-20T19:33:19Z")

</div>

Can you try to set “AllowBackgroundAudio” to true in the editor settings?  
It is disabled by default - and I think that is why you are not hearing any sound (because the second PIE window has no user focus and thus is in the background)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/2/3/623f9d9d022d78bd366d5cd1a51ef02362869fd7.png)  
Let me know if this fixes it 👍

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [March 20, 2024, 7:57pm UTC](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/3 "2024-03-20T19:57:04Z")

</div>

Hi @Featuriing

Unfortunately that didn’t solve the problem.

Thank you very much for your help.  
Very appreciated ❤

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [March 20, 2024, 8:41pm UTC](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/4 "2024-03-20T20:41:37Z")

</div>

You are right about the focus and the sound.  
When the PIE window is not focused, the sound is not heard.  
I just did a test on my original project.  
However, the option “Level Editor/Miscellaneous/Allow Background Audio” does nothing…  
it seems to be broken… Maybe it’s a bug.  
I have version UE5.3.2  
It would be nice if someone else could confirm this.  
I have been on the verge of madness for two days looking for a solution to this.

Thank you so much @Featuriing !!

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [March 21, 2024, 7:44am UTC](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/5 "2024-03-21T07:44:25Z")

</div>

I reported the bug… i hope they can fix it soon

> [@I think "Allow Background Audio" is not working](https://forums.unrealengine.com/t/i-think-allow-background-audio-is-not-working/1764161):
>
> I opened a thread on the forum because the audio doesn’t seem to work in a specific situation. You can see all details here: A user gave me a solution: ENABLE: “Level Editor/Miscellaneous/Allow Background Audio” But that option doesn’t seem to work (See Video Attached Here). I think the user is right, and seem that option doesn’t work like he says it should. In any case i cannot test the audio correctly. If it is a bug, please fix it. And if you know a console command to enable …

Thank you so much for your help @Featuriing ❤

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 20, 2024, 7:44am UTC](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/6 "2024-04-20T07:44:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
