0
\$\begingroup\$

Environment: Windows 10 (fresh install), using Monogame 3.6 (same goes for 3.5 for this matter) on DirectX projects. Problem: I can’t hear any sound effect unless I reinstall DirectX.

Before reinstalling DirectX, there is no exception or status information I could use to trace why the sound is not audible. After reinstalling, it just works. Same code, even same binary.

I don’t want my users to have to reinstall DX. This will be awkward as Win10 comes with DX pre-installed.

So I wonder if someone knows which additional DX libraries I may include in project folder so that the sound effects are audible without reinstalling DX?

\$\endgroup\$
1
\$\begingroup\$

This is most likely one of the following XAudio DLLs (list taken from my own PC, date formats may be diferent for you), all present in C:\Windows\System32:

05/03/2008  17:04           489,480 XAudio2_0.dll
30/05/2008  15:19           511,496 XAudio2_1.dll
31/07/2008  11:40           513,544 XAudio2_2.dll
27/10/2008  11:04           518,480 XAudio2_3.dll
16/03/2009  15:18           521,560 XAudio2_4.dll
04/09/2009  18:44           517,960 XAudio2_5.dll
04/02/2010  11:01           530,776 XAudio2_6.dll
02/06/2010  05:55           518,488 XAudio2_7.dll
18/03/2017  21:57             3,584 XAudio2_8.dll
18/03/2017  21:57           574,464 XAudio2_9.dll

When Microsoft still issued the old DirectX SDK they frequently issued new DLLs for certain components with it, bumping the version number, and making them incompatible with any PC that was running an older version of the runtimes. Unfortunately, they also didn't include these updated DLLs with fresh installs of Windows either. The same thing happened with D3DX DLLs and hence the fact that re-installing DirectX appears to fix it. It's not actually a full reinstall of DirectX; all that happens is the missing DLLs are copied over and everything then works.

The good news is that this most likely won't affect your users. Anybody who has run a Direct3D 9 game on their PC has likely already had the DLLs updated. If not the DirectX End-User Runtime Web Installer provides a lighter download that will only grab the missing components.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Looked like a good solution or starting point, but so far it didn't lead anywhere. This is what I tried: - create a snapshot from the machine before updating DX - update DX and copy XAudio* from C:\Windows\System32 (also tried with XAPOFX* as these also looked promising) - test that sound works (it does) - restore snapshot - copy previously saved XAudio* anx XAPOFX* to C:\Windows\System32 - register all XAudio (as these are com dlls) - test to see if sound works (it doesn't) \$\endgroup\$ – Grabiobot Jun 21 '17 at 16:12
  • \$\begingroup\$ Note that XAudio2_8.dll and XAudio2_9.dll are part of the Windows 10 operating system. You can't install them on Windows 7, and they are not included in the legacy DXSETUP package. Also, see the answer I posted in StackOverflow as you have cross-posted this question. \$\endgroup\$ – Chuck Walbourn Jun 22 '17 at 6:53
  • \$\begingroup\$ Note that the only way you are allowed by the DirectX SDK EULA to deploy XAudio2_7.dll or earlier is via DXSETUP which you can trim down to just a couple of CABs and the installer EXEs. It still requires admin rights to launch the installer. Alternatively, you could rebuild the Monogame components to use XAudio 2.8 or later by not supporting Windows 7. \$\endgroup\$ – Chuck Walbourn Jun 22 '17 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.