Sign in to follow this  
Crazyfool

DirectSound C++

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this