DXSound - 3D problem (again)

Started by
0 comments, last by melonjelly 21 years, 7 months ago
Hi! I hope anybody could help me. I have a weird problem going on with 3DSound using Direct Audio 8.1. Either my 3D soundbuffers don''t move as expected or my 3D listener does not change its position. I have ONE global 3D listener object managed by my audio-engine which I get from the primary sound buffer like this: DSBUFFERDESC dsbd; LPDIRECTSOUNDBUFFER lpdsbPrimary; ZeroMemory(&dsbd, sizeof(DSBUFFERDESC)); dsbd.dwSize = sizeof(DSBUFFERDESC); dsbd.dwFlags = DSBCAPS_CTRL3D | DSBCAPS_PRIMARYBUFFER; if SUCCEEDED(directSound->CreateSoundBuffer(&dsbd, &lpdsbPrimary, NULL)) { // Get listener interface. if FAILED(lpdsbPrimary->QueryInterface(IID_IDirectSound3DListener8,(void**)&listener3D)) { cerr << "Failed to get 3D audio listener in audio path." << endl; lpdsbPrimary->Release(); } } everything works fine here and I don''t get any errors. BUT whenever I try to change the position of my listender nothing happens!!! i.e. listener3D->SetPosition(10.0f, 0.0f, 10.0f, DS3D_IMMEDIATE); the listener seems to be stuck to my gameworld origin (because the closer I am to 0/0 the louder the sound - which plays on a 3D audio-path - gets) Does anybody have an idea what''s going on here? Thanks in advance!
Advertisement
i think the position should be of unit length, so try values between -1 and 1.

that should work

This topic is closed to new replies.

Advertisement