0
0

Hi, I’m working on a small OpenGL shooter (under Windows). I had some problems with Fmod at the beginning: Position of the Listener or the source did not seem to matter, only the orientation of the listener. This was because I only called FSOUND_3D_Update() before playing a sound effect, not in every frame.

Now I’m calling the Update function in every frame, but still it seems like the original non 3D-sound can be heard for maybe half a second, producing a cracking noise in the speakers – depending on the orientation of the listener.

I tried it on another computer, and there I could hear no cracking sound, but after about 25 shots the game is completely silent until another 25-30 shots are fired. And so on.

Anyone recognises those symptoms? I’m using FMOD 3.4.0 and it doesn’t matter if DSound or WinMM is used.

Tobias

  • You must to post comments
0
0

You can redownload fmod, it has a ‘crack’ noise bug fix, you can also adjust the buffersize, i hope it ll help.

  • You must to post comments
0
0

[QBS]Quadrant
Hi im still having problems too using positioned sound, to be honest its frustrating me but i need to get it to work :sad:

Quadrant@PlanetQuake.com
http://www.planetquake.com/quadkill/quadengine

  • You must to post comments
0
0

[QBS]Quadrant

Im not sure im doing this correctly how do i use £ dimentional sound ???

My player ie (Camera)
ie is this correct
X -X left to +X right
Y -Y back to +Y forward
Z -Z down to +Z up
//[QBS] Set SND listener position to Camera
for(i=-0;i<2;i++) //[QBS] count 0 to 2
{
X[i]=C->ToWorld[i][0]; //X right
Y[i]=C->ToWorld[i][1]; //Y up
Z[i]=C->ToWorld[i][2]; //Z forward
}

//[QBS] copy camera location to listener position in 3D space
listener_pos_x[i]=X[i];//x -X left to +X right
listener_pos_y[i]=Y[i];//y -Y down to +Y up
listener_pos_z[i]=Z[i];//z -Z back to +Z forward

//vel

// Ok now update 3D
FSOUND_3D_Update(); //UPDATE EVERY FRAME OF CAMERA

ok next if we go into the playing of a sound

//[QBS] TESTING
float listenerpos[3] = { 0,0,0 }; // Init player as 0
float lastpos[3] = { 0,0,0 }; // and his last position
float pos[3] = { -10.0f, -0.0f, 0.0f };
float vel[3] = { 0,0,0 };

define INTERFACE_UPDATETIME 50 // 50ms update for interface

void Play_Explode_Sound (float *c)
{
// COORDINATE SYSTEM : X = right, Y = up, Z = forwards. (Left handed)
extern float listener_pos[3]; // Location of listener
extern float listener_vel[3]; // Location of listener

    extern  float last_pos[3]; // old location of listener
    extern  float last_vel[3]; // old location of listener

    extern  float pos[3];// from sound object
    extern  float vel[3];// from sound object

FSOUND_STREAM   *explode_sound = NULL;
FSOUND_MATERIAL *material = NULL;
explode_sound  = NULL;

if (!sound_inited)return;

explode_sound = FSOUND_Stream_OpenFile(“sound/fx/rockex.mp3”, FSOUND_NORMAL | FSOUND_HW3D,0);
if (!explode_sound)
{
printf(“explode_sound ERROR: %sn”, FMOD_ErrorString(FSOUND_GetError()));
}

        vel[0] = (listener_vel[0]-last_vel[0]) * (1000 / INTERFACE_UPDATETIME);
        vel[1] = (listener_vel[1]-last_vel[1]) * (1000 / INTERFACE_UPDATETIME);
        vel[2] = (listener_vel[2]-last_vel[2]) * (1000 / INTERFACE_UPDATETIME);

// COORDINATE SYSTEM : X = right, Y = up, Z = forwards. (Left handed)
// store pos for next time
last_vel[0] = listener_vel[0];
last_vel[1] = listener_vel[1];
last_vel[2] = listener_vel[2];

        pos[0] = pob.c[0];
        pos[1] = pob.c[1];
        pos[2] = pob.c[2];

// Update camera position
// if (DoCameraSync)
SyncCamera(C,cl);

// No world bsp!
if (!cl->MainBSP) return;

//[QBS] Set sound to its world location
for(i=-0;i<2;i++) //[QBS] count 0 to 2
{
X[i]=C->ToWorld[i][0]; //X right
Y[i]=C->ToWorld[i][1]; //Y up
Z[i]=C->ToWorld[i][2]; //Z forward
}

//[QBS] position in 3D space
listener_pos_x[i]=X[i];//x -X left to +X right
listener_pos_y[i]=Y[i];//y -Y down to +Y up
listener_pos_z[i]=Z[i];//z -Z back to +Z forward

// COORDINATE SYSTEM : X = right, Y = up, Z = forwards. (Left handed)
// store pos for next time
last_pos[0] = listener_pos[0];//X -X left to +X right
last_pos[1] = listener_pos[1];//Y -Y down to +Y up
last_pos[2] = listener_pos[2];//Z -Z back to +Z forward

FSOUND_3D_SetAttributes(FSOUND_FREE,pos,vel);// the sound

FSOUND_Stream_Play3DAttrib(FSOUND_FREE, explode_sound,-1,-1,-1,pos,vel);
FSOUND_3D_Listener_SetAttributes(listener_pos,vel, listener_pos_x,listener_pos_y,listener_pos_z,listener_vel_x,listener_vel_y,listener_vel_z); // the listener

}

AM i doing this anywhere near correct its making me pooly trying to work it out :sad:

  • You must to post comments
0
0

MMhhh … euh … i don’t see any error in you code … strange, perhaps Master Brett will see something, because, for me, the code is correct.

  • You must to post comments
0
0

KarLKoX – redownload Fmod? The filesize is still the same as my 3.4.0 version. When has the ‘cracking’ bugfix been applied?
Greetings, Tobias

  • You must to post comments
0
0

You can read this topic :

http://52.88.2.202/forum/viewtopic.php … forum=2&12

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.