SoundEffects not working on Windows machines (DirectX)

I’m building a game using Monogame (v3.4). My monogame project is DirectX based (not OpenGL) on Windows 7.

I’ve recently ran into a problem with the SoundEffects (I’ve seen similar posts here that don’t really provide a solution). On my PC (DirectX = v11) the SoundEffects and Songs work fine, however whenever I try to run the game on another (Windows 7, Windows 10, etc., same DirextX versions) machine the Songs work fine but the SoundEffects don’t work at all. No error is produced.

The solution to this problem is easy (ref1). The user needs to run the latest DirectX runtime installer - this fixes the problem (adds some missing SDKs, not sure) the SoundEffects work again.

The actual problem is: why is this happening? Why does the user need to upgrade their already installed-directx version to get the sound to work? This seems like a huge nuisance from the perspective that the game itself might be small (10mb) but requires extra installations/downloads (not to mention if the game is a standalone on-the-go executable without an installer)

Is there a resolution to this? Is this a monogame bug or a directx bug? Is there a way I can take control of this bug (without doing those full-check installers, etc.) instead of informing the user to install some requirements?

Based on this link (ref2) it seems to be generated from SharpDX’s execution of DirectSound… or is it XAudio2 related (as per linked page)?

Is there anyway I could catch this bug in the code-end (try-catch etc.)?

I can confirm that. The soundEffect has a depentency on DX 9c.
Recently I had a fresh install of win8.1. Normally you don’t see that because sooner or later a game will install DX9c for you. For desktop apps you can add the DX in your install but I have no idea what would happen on Store apps.

I would not recommend installing DX from the link above because microsoft bundles it with ‘MSN default homepage & Bing default search engine’ adware, spend a day trying to un-install that $#1&. Totally not cool.

1 Like

Can you get around this without bundling DX9c?

If not what is the best way to bundle it with a game?

Sadly I couldn’t find a solution to this.

In the end I had to use an installer for game distributions (which bundled with DirectX stuff)

Inno Setup was the most convenient/easiest one (though really there aren’t many installers on the net).

If you configure the Inno Setup build correctly it would create an installer that comes with a prompt to install Direct X etc. with little effort. Pretty handy.

Not a bad solution thanks.

I remember with Terraria always having to install DirectX and .NET redist. with it and it came with it so perhaps most people are familiar with it.

Wonder if there is any way to just have the dll in your game directory?

I wonder if this is something MonoGame can move away from?

So bizarre that you can install Win 10 and DX12 but this part of DX never comes in :frowning:

I have no idea, nobody has looked into it as far as I know. You see, once you install DX9c you can no longer uninstall it from the system. So, tracking down this bug requires a certain amount of investment (install a new clean OS, etc).