Monogame: WAV doesn't play
This is MonoGame 3.4 and I am using it through VS2013. I am compiling my WAV file using mgcb in the same way as my textures. MGCB works great, but when it comes to playing audio using a class SoundEffect
, it doesn't play anything. An exception is thrown and the function SoundEffect.Play()
returns true
, but I can't hear anything. Here's my code:
Loading:
JumpSound = content.Load<SoundEffect>("SpinJump");
A game:
var Ins = JumpSound.CreateInstance();
Ins.Volume = 1f;
Ins.Play();
The same code plays audio perfectly in an XNA project. Is this a known bug or something else?
source to share
I had the same problem. My solution was to reinstall DirectX. For some reason this helped. I was running Windows 10 and VS 2015 Community Edition. I also installed XNA where the same code worked fine!
After reinstalling DirectX ( https://www.microsoft.com/en-us/download/details.aspx?id=35&84e4d527-1a2f-c70a-8906-a877ec4baada=1 ) the SoundEffect class started working again!
Hope it helps.
source to share