Hi … this is my first post here so bare with me.

I have created 3 classes a listener, emitter and sampler object. The sampler object is supposed to handle all the fmod initialisation to get correct sound card etc … which as far as i know is working correctly!
The emitter is going to be used to emit sounds from objects in our 3d environment however its not really used yet. Finally the listener is effectively our camera position, however i am updating the 3d_listener attributes and no changes are being reflected in the output sounds. Heres some of the relevant code: –

int main (int argc, char *argv[])
FModSampler temp;
vec3 pos(0, 0, 0);
vec3 vel2(0, 0, 0);
float vel[3] = { 0, 0, 0 };

/* loads the sample at a specified position */
temp.loadSample ("sounds/planeidle.wav", 0, 0, 0.0, 0.0);

/* plays it*/
temp.playSound (0, pos, vel2, 255);

//FModEmitter emitter; not yet!
FModListener l;

pos[0] -= 1;
l.changePosition (pos);
.... similar statments to test it


The listener object is created from the following:

FModListener::FModListener ()
    this->position.x = this->position.y = this->position.z = 0;
    this->velocity.x = this->velocity.y = this->velocity.z = 0;
    this->forward.x = this->forward.y = this->forward.z = 0;
    this->top.x = this->top.y = this->top.z = 0;
    setListener (this->position, this->velocity, this->forward, this->top);

and set listener is obviously like this: –

void FModListener::setListener (vec3 pos, vec3 vel,
vec3 forward, vec3 top)
this->position = pos;
this->velocity = vel;
this->forward = forward;
this->top = top;
float temp[3] = { this->position.x, this->position.y, this->position.z };
float temp2[3] = { this->velocity.x, this->velocity.y, this->velocity.z };

FSOUND_3D_Listener_SetAttributes (temp, temp2, 
                                  forward.x, forward.y, forward.z,
                                  top.x, top.y, top.z);
//setPosition (pos);

changePosition (vec3 pos) … very similar to above!
…. basically we have a generic vector class that we r using that contains position coordinates ….

For some reason after it does the FSOUND_Update () we do not hear any changes in the 3d sound …. help !

Much appreciated … nick
ps find me on msn messenger if u can help and need any additional information … nisgar2k@hotmail.com


  • You must to post comments

i have already answered my own question i had set the initial forward and top vectors to 0 in the listener. Duh … i cant believe i did that and fmod didnt crash! It was effectively tell the listener to look at its self rather then at the world 😕

sorry all for this post!
hope it helps others anyway

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.