Advertisement Jump to content
Sign in to follow this  

IDirectSound3DBuffer8 vs IDirectSoundBuffer8

This topic is 4968 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 would like to set the frequency (at which the audio samples are played) of an IDirectSound3DBuffer8 object, which parameter of the interface could do the job ? I know that IDirectSoundBuffer8 have the SetFrequency and GetFrequency methods to do that. Thanks Fathya

Share this post

Link to post
Share on other sites

The IDirectSoundBuffer8 interface and the IDirectSound3DBuffer8 are two interfaces exposed by the same object. They are just two different ways of interacting with it. What this means is that you can use the two in conjunction to manipulate the quality AND location of a sound.

In practice this means you can get an IDirectSoundBuffer8 interface. And then use the COM QueryInterface function to get access to the IDirectSound3DBuffer8 interface for that object.

Here's the code:

// Use this to create an IDirectSoundBuffer
// Make sure the DSBUFFERDESC struct contains DSBCAPS_CTRL3D enabled
HRESULT CreateSoundBuffer(

// Once you've got the sound buffer, use QueryInterface to get the IDirectSoundBuffer8 Interface
ppDSBuffer->QueryInterface( IID_IDirectSoundBuffer8, (void**)&pSoundBuffer );

// Now you can use the pSoundBuffer to set frequency, etc...
// But you can also use it to get the 3d sound interface
pSoundBuffer->QueryInterface( IID_IDirectSound3DBuffer, (void**)pSoundBuffer3D );

Now you can use the two interfaces, pSoundBuffer and pSoundBuffer3D to set the positions, frequency, pan, position, combination.

Hope this helps, mate! Good luck!

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!