# PlaySound vs PlaySoundW

**URL:** <https://forums.unrealengine.com/t/playsound-vs-playsoundw/430805>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 2, 2018, 1:23pm UTC](https://forums.unrealengine.com/t/playsound-vs-playsoundw/430805 "2018-08-02T13:23:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dune](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dune](https://forums.unrealengine.com/u/Dune)\
**Post date:** [August 2, 2018, 1:23pm UTC](https://forums.unrealengine.com/t/playsound-vs-playsoundw/430805/1 "2018-08-02T13:23:47Z")

</div>

I recently updated one of our projects to 4.20 and began having a linker error from using ‘WidgetRenderer’. After looking around I found someone suggesting also including ‘#include “Runtime/UMG/Public/UMG.h”’ and I think that sorted this issue.

However, that opened up another issue:

Error C2039 ‘PlaySoundW’: is not a member of ‘FSlateApplication’ MyProject MyEngineDir\engine\source\runtime\slate\public\Widgets\Input\SComboBox.h 484

I have tracked this down to my project using Photon and possibly some AllowWindowsType stuff, amoung other things. Was wondering if anyone has had similar issues with plugins causing these issues or if there is a way around them. It seems to be confusing the PlaySound from FSlateApplication with the default windows PlaySoundW.

---

<div class="post-metadata">

**Author:** ![Dune](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dune](https://forums.unrealengine.com/u/Dune)\
**Post date:** [August 9, 2018, 12:15pm UTC](https://forums.unrealengine.com/t/playsound-vs-playsoundw/430805/2 "2018-08-09T12:15:13Z")

</div>

Seems that one of my Plugins (Photon defines.h) was using "include ". I removed it as Photon didn’t seem to use it and it stopped complaining.  
Looks like some dependancy stuff with how modules are loaded possible.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_30913926](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_30913926](https://forums.unrealengine.com/u/anonymous_user_30913926)\
**Post date:** [April 16, 2019, 4:06pm UTC](https://forums.unrealengine.com/t/playsound-vs-playsoundw/430805/3 "2019-04-16T16:06:29Z")

</div>

I realize this is a bit late to reply, I had this problem when using ComboBoxes as well and the way I solved it was to add the function to SlateApplication.h and define it in the SlapeApplication.cpp.  
I gave it the same exact parameters and statement as PlaySound.

This is probably not the optimal way to solve the issue but it worked for me and was pretty easy to implement.

---

<div class="post-metadata">

**Author:** ![Dune](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dune](https://forums.unrealengine.com/u/Dune)\
**Post date:** [April 16, 2019, 6:00pm UTC](https://forums.unrealengine.com/t/playsound-vs-playsoundw/430805/4 "2019-04-16T18:00:36Z")

</div>

Hey, appreciate the answer. I’ve had other issues with GetObject and GetObjectW and have decided to at the top of the files that are giving the errors, using:  
#ifdef PlaySound  
#undef PlaySound  
#endif

Seems to work but also isn’t ideal.
