# Why PlaySound2D does work when press a key but not when the event is triggered?

**URL:** <https://forums.unrealengine.com/t/why-playsound2d-does-work-when-press-a-key-but-not-when-the-event-is-triggered/1760323>\
**Category:** Getting Started & Setup\
**Tags:** Networking, hud, unreal-engine, Widget, Blueprint, question, CPP\
**Created:** [March 18, 2024, 12:35pm UTC](https://forums.unrealengine.com/t/why-playsound2d-does-work-when-press-a-key-but-not-when-the-event-is-triggered/1760323 "2024-03-18T12:35:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:38am UTC](https://forums.unrealengine.com/t/why-playsound2d-does-work-when-press-a-key-but-not-when-the-event-is-triggered/1760323/5 "2024-03-21T07:38:02Z")

</div>

HI @eldany.uy

I think we fund the problem

> [@I need help to fix an audio problem (UserWidget)](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/2):
>
> 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] Let me know if this fixes it +1

Unfortunately the solution seem to be bugged

> [@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: [https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544?u=ivan3z](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544) A user gave me a solution: [https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/2?u=ivan3z](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/2) ENABLE: “Level Editor/Miscellaneous/Allow Background Audio” But that option doesn’t seem to work (See Video Attached Here). [https://forums.un…](https://forums.unrealengine.com/t/i-need-help-to-fix-an-audio-problem-userwidget/1762544/3)

Anyway i want thank you for your help!! ❤

---

_[View the full topic](https://forums.unrealengine.com/t/why-playsound2d-does-work-when-press-a-key-but-not-when-the-event-is-triggered/1760323)._
