

My game's installer should automatically install the required DirectX components, but it's possible that has failed for some of my players, or that they are running the executable without running the installer. In that thread, someone asks,Īre you sure those machines have the same DirectX version installed? I did find an old thread from someone who has the same issue, but there was no resolution to that.

I am definitely *not* doing either of these things, and so I'm at a loss as to why it would be returning XAUDIO2_E_INVALID_CALL. If you call CreateMasteringVoice within a callback, it returns XAUDIO2_E_INVALID_CALL. It is invalid to call CreateMasteringVoice from within a callback (that is, IXAudio2EngineCallback or IXAudio2VoiceCallback ). If you attempt to create more than one voice, XAUDIO2_E_INVALID_CALL is returned. XAudio2 only allows one mastering voice to exist at once. The docs for CreateMasteringVoice mention two reasons why it might return XAUDIO2_E_INVALID_CALL: (XAudio2Create is returning success and outputting a non-NULL pointer.) The logging statement above has also verified that the XAudio2 device is being created successfully. I think it's pretty unlikely that SharpDX is to blame here, because it's a very thin wrapper around the native DirectX APIs and I couldn't find any obvious issues in its source code. My application then catches that exception at a higher level (not shown) and reports it to me.) (If you're unfamiliar with SharpDX, the important thing to point out is that SharpDX automatically checks for error codes returned from DX functions and throws an exception if an error is returned. MasteringVoice = new MasteringVoice(Device) Logger.Log("XAudio2 Device NativePointer: " + ("X")) But occasionally I get automated error reports from players which indicate that my call to IXAudio2::CreateMasteringVoice is returning XAUDIO2_E_INVALID_CALL.ĭevice = new XAudio2(XAudio2Flags.None, ProcessorSpecifier.DefaultProcessor)

For myself and 99% of my players, everything is working fine. I have written a game that uses XAudio2 (via the SharpDX wrapper for C#).
