Sign in to follow this  
akhin

3D Sound programming with DirectX or Windows SDK (DirectShow)

Recommended Posts

akhin    104
Hi all ,

I looked at forum topics , still not sure if the question is for the right place
but sorry if it does not fit here

To implement 3D Sound , in all examples I have seen , people are using
DirectMusic with DirectSound.

Actually what I am looking for is either of these :

1. Implementing with Directshow , I am ok with Directshow but I dont know how to use `3DListener` interfaces with them if it is possible

2. Implementing with only DirectSound and getting rid of DirectMusic. Since DMusic is deprecated.

Id appreciate it any answer

Share this post


Link to post
Share on other sites
Buckeye    10747
I use just DirectSound. Actually, I'm not familiar with DirectShow or DirectMusic so that's a default.

I create the DirectSound object and set the speaker config to DSSPEAKER_HEADPHONE for the best effect.

I create one or more sound buffers for the desired sound(s) with creation parameters = DSBCAPS_CTRL3D and guid3DAlgorithm = DS3DALG_HRTF_FULL.

I get (and retain) the 3dlistener interface from the primary buffer.

During gameplay, in my update function, I set the sound buffer parameters to reflect the current position of the sound(s), and set the 3dlistener params to my player's current position and direction.

Then.. play the sound(s).

Share this post


Link to post
Share on other sites
Yartch    116
You should look into XAudio2, it's pretty standard now. I haven't tried 3D sounds with it yet, but from I've just quickly looked up, the X3DAudio API seems to work well with it. It only took me a few hours in a couple days to get from not knowing a thing about XAudio2 to having a working sound engine.

http://msdn.microsoft.com/en-us/library/ee415737(v=VS.85).aspx

Share this post


Link to post
Share on other sites
itsdbest    134
Quote:
Original post by Yartch
You should look into XAudio2, it's pretty standard now. I haven't tried 3D sounds with it yet, but from I've just quickly looked up, the X3DAudio API seems to work well with it. It only took me a few hours in a couple days to get from not knowing a thing about XAudio2 to having a working sound engine.

http://msdn.microsoft.com/en-us/library/ee415737(v=VS.85).aspx




I would second that. Having just started my journey with DirectX, I have to say XAudio2 is the way to go.

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