Jump to content
  • Advertisement
Sign in to follow this  
Crazyfool

DirectSound C++

This topic is 3465 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

Hi, I've been googling and looking through MSDN and other articles but cannot find anything useful to introducing directsound. Gamedev's articles seem to be using directmusic which is no longer supported (I believe). It seems that sound is a lot more difficult than I expected. I basically am looking for any decent sample/tutorials on DirectSound in which I can see how to load and play a sound. Should I just go to OpenAL? It seems it has more resources for basic sound programming. I am trying to stay clear of OpenAL due to requiring additional dependencies, but if it is recommended, I shall give it a try. Thanks in advanced!

Share this post


Link to post
Share on other sites
Advertisement
Unfortunately DirectSound does not include any way to directly load WAV files into IDirectSoundBuffers. As this tutorial demonstrates, the MMIO section of the Windows API can be used to parse a WAV file and copy it into a buffer.

This is really the worst bit. Once you have your buffer loaded, playing it, stopping it, setting the pan and volume etc are fairly self explanatory from the sound buffer interface.

If you are targetting Vista, though, it is worth having a scan through this Wikipedia entry, in particular the Windows Vista section that explains about XACT.

You can still use DirectSound on Vista but (on my PC at least) you need to specify software processing when you create the DirectSound device.

Share this post


Link to post
Share on other sites
I appreciate this. You know, I've looked through google many times, up to at least 6-7 pages and did not see this. Either I'm blind or google has finally failed me.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!