I’m trying to use fmod for a 3D tank game. It’s a wonderful API and I just have a few questions.

I’ve tried to search for my exact question, but couldn’t find anything that went over this exact problem of mine.

My problem I have various explosions occuring in my world at one time all around the players tank and sometimes when the tank is turning quickly sounds seem to be cut off (stopped short). It’s almost as if it cannont figure out which speaker to play from. I’m am pretty sure my listeners orientation and velocity are set up properly. Could this be a hardware issue? I’m using a labtop with a pretty crappy soundcard.

Here is my update function (called once per frame)

void CAudioManager::Update()
float listenerpos[3];
float listenervel[3];

CVector3f camerapos;

listenervel[0] = (camerapos.x – cameralastpos.x) / g_FrameTime;
listenervel[1] = (camerapos.y – cameralastpos.y) / g_FrameTime;
listenervel[2] = (camerapos.z – cameralastpos.z) / g_FrameTime;

cameralastpos = camerapos;

listenerpos[0] = camerapos.x;
listenerpos[1] = camerapos.y;
listenerpos[2] = camerapos.z;

CVector3f cameraLookAt;

CVector3f cameraUp;

FSOUND_3D_Listener_SetAttributes(listenerpos, listenervel, cameraLookAt.x, cameraLookAt.y, -cameraLookAt.z,
cameraUp.x, cameraUp.y, -cameraUp.z);


And here is where I Update my sound (only done once since explosions do not move)

void CAudio::UpdateSound(CVector3f pos, CVector3f vel)
float posvec[3];
float velvec[3];

posvec[0] = pos.x;
posvec[1] = pos.y;
posvec[2] = pos.z;

velvec[0] = 0.0f;
velvec[1] = 0.0f;
velvec[2] = 0.0f;

FSOUND_3D_SetAttributes(m_Channel, posvec, velvec);

Any help would be greatly appreciated.


  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.