0
0

Hi, I seem to have some problems getting 3D sound to work. In fact, when I call FSOUND_Update, none of my sound effects seem to work (even the non 3D ones). Is it possible to mix non 3D and 3D sound effects ?

I initalize FMod by calling:
FSOUND_Init(44100, 32, 0);

I am intializing my 3D sound by calling:
sfx = FSOUND_Sample_Load(FSOUND_FREE, “Data/sounds/sfx.wav”, FSOUND_HW3D | FSOUND_LOOP_NORMAL, 0, 0);
bool test = FSOUND_Sample_SetMinMaxDistance(sfx, 1.0f, 100.0f);

I call FSOUND_Update every frame.
I set the distance factor to:
FSOUND_3D_SetDistanceFactor(39.36); // inches

I set FSOUND_3D_SetAttributes(channel, pos, NULL); for my object once.
I set the “ears” to:
FSOUND_3D_Listener_SetAttributes(ears_pos, NULL,
player_model->returnDirection().x,
player_model->returnDirection().y,
player_model->returnDirection().z,
player_model->returnNormal().x,
player_model->returnNormal().y,
player_model->returnNormal().z);

Any ideas what I may be doing wrong ? If I dont call FSOUND_Update, I can hear my sound effects, but my 3D sound is not in 3D. By the way, I initailize my “non-3D” sounds like this:
sfx = FSOUND_Sample_Load(FSOUND_FREE, “Data/sounds/menu_highlight.wav”, FSOUND_LOOP_OFF, 0, 0);

Thanks,

Nitzan

  • You must to post comments
0
0

Thanks Brett,

I added FSOUND_HW2D to the 2D sounds and that solved it.

What “3D Example” are you refering to ?

Unfortunatley my 3D sound still does not work. I checked with the debugger and the values I am passing seem to be correct. I also tried messing with the distance factor and the min-max distances, but to no avail.

Can someone point me to a working example of 3D sound perhaps ?

Thanks,

Nitzan

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.