Sign in to follow this  
HendrixSweden

DirectSound 3D Listener problem

Recommended Posts

Hi, I'm developing a board game in a 3d environment. I thought it would be nice to hear where you put your stones on a board (the game of Go, also named weiqi). Here is some details I hope I've got right.. Looking at the Play3dSound example in the SDK. To accomplish this I use Mono waves as stated in the documentation, setting coop level to DSSCL_PRIORITY. SetFormat to 2 channels 44100Hz 16 bit audio. Using the DSBCAPS_CTRL3D flag to get a 3d listener. When adding a new sound I use the following flags when creating buffer DSBCAPS_CTRL3D, DS3DALG_HRTF_FULL and setting dwMode = DS3DMODE_NORMAL; Now I should be able to position the soundbuffer in world space? .. In units of meters. And I update the 3D listener object as my camera moves in the world with the following code. memcpy(&m_dsListenerParams.vPosition, vPos, sizeof(D3DVECTOR)); memcpy(&m_dsListenerParams.vOrientTop, vUp, sizeof(D3DVECTOR)); memcpy(&m_dsListenerParams.vOrientFront, vFront, sizeof(D3DVECTOR)); memcpy(&m_dsListenerParams.vVelocity, vSpeed, sizeof(D3DVECTOR)); m_pDSListener->SetAllParameters( &m_dsListenerParams, DS3D_IMMEDIATE ); I'm pretty sure that all the vectors are ok, the vPos, vUp, vFront and vSpeed But as I move around in the world, placing stones on the boards, the sounds doesn't always come from the correct direction.. So, I might be missing something fundamental when not using the HEAD_RELATIVE mode as they use in the example in the SDK. Has someone got any ideas of why the sound doesn't always come from the correct directions ??? =)

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