Jump to content
  • Advertisement
Sign in to follow this  
RoyChen204

OpenGL Direct Sound

This topic is 3627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I seem to be unable to use DirectSound in my projects. I added dmusici.h, dmusicc.h and d3d8types.h, but when I did this IDirectMusicLoader8 *Loader; and changed it to NULL at starting, following the book on Opengl Game Programming, and linked dxguid.lib ,dsound.lib ,dxerr8.lib. However it seems to fail to create the loader object, cause each time it hits the test it fails. The test is if (FAILED(CoCreateInstance(CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, IID_IDirectMusicLoader8, (void**)&Loader))) Could someone help me please?

Share this post


Link to post
Share on other sites
Advertisement
What error code do you get? If you print out the return value as an 8-digit hex number, it should look like 0x88760001 or something.

Also, I'm not sure, the Debug Runtimes might help (Ignore the D3D specific stuff in that link).

Also, it may be worth mentioning that DirectMusic isn't recommended any more, I believe XAudio or XACT is preferable (Although I can't recall which) for music, or plain DirectSound for low level audio stuff.

EDIT: Have you called CoInitialize before calling CoCreateInstance?

Share this post


Link to post
Share on other sites
In addition to Steves point on debug, I started using the DirectSound Debug runtime yesterday, and found the control panel is only half the answer. (It'll do nothing if you just drag that slider to max).

You need to download the DXSDK extras which will include a debug version of dsound.dll. Stick that in your run directory and you'll start seeing the debug output.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!