I am a blind programmer, working on an audio game for the blind. I am using SlimDX, and it has been tested on dozens of systems from XP to Win 8.1. My code works on most systems just fine, but I am getting the following error at runtime on a handful of older XP systems:
vupgraderacer.wav SlimDX.DirectSound.DirectSoundException:
DSERR_INVALIDCALL: This call is not valid for the current state of this object (-2005401550)
at SlimDX.Result.Throw[T](Object dataKey, Object dataValue) at SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue) at SlimDX.DirectSound.SecondarySoundBuffer..ctor(DirectSound device, SoundBufferDescription description) at RR.Sound..ctor(String fileName)
The same error is repeated for each sound it is trying to use. Here is the code I am using to setup the DS device:
dsDevice = New SlimDX.DirectSound.DirectSound
dsDevice.SetCooperativeLevel(OGw.Handle, SlimDX.DirectSound.CooperativeLevel.Normal)
I realize there are other flags that can be set, but this basic setup has worked well thus far, minus the older XP systems. This is my first post, so hope I am entering it properly, if not, please let me know, it is sometimes difficult to tell where you are or should be with a screenreader on forums.
SetCooperativeLevel()
? It returns aHRESULT
so any value other thanDS_OK
may indicate a problem. \$\endgroup\$