Audio Error When Packaging Game (audio doesn't play in packaged game)

I just finished my first game and packaged it for Windows 64-bit, but when I open the packaged game it doesn’t play any audio. I looked in the output log for any errors/warnings related to the audio and found this:

LogAudio: Error: CreateMasteringVoice error: Unhandled error code -2005139406
LogInit: Warning: Failed to create the mastering voice for XAudio2

No idea what to do to fix it and there doesn’t seem to be any solution online. Any help would be greatly appreciated, thanks!

[FONT=“Noto Sans”]For those who may read this in the future, I was able to fix this by switching my build configuration to shipping. If you don’t know how to do this, go to file - package project - build configuration

1 Like

It works in UE5! Thank you!